Convert UNC to local path on remote machine

G

Guest

It seems like a simple question, but I am unable to find any succinct answer
to this problem.

If I am provided a UNC, how can I convert it to it's absolute path on the
remote machine.

For example, machine MyServerA has a share created on a folder
c:\stuff\photos and it is called "SharedPhotos".

What code is required so that when executed on machine MyServerB, given the
UNC \\MyServerA\SharedPhotos, I will get a result of c:\stuff\photos?


I am using the 2.0 framework, so if there are any new classes that I can
leverage with this release, then feel free to enlighten me.

Given that I will not have any credentials provided outside the current
WindowsIdentity of the user logged into MyServerB, will there be any
permission issues when executing the code?

Thanks in advance for any help.

Cheers, Ian
 
C

chanmm

If you type \\MyServerA\SharedPhotos from MyServerB Windows Explorer and is
fine then it should be fine.

chanmm
 
J

james

Ian Williamson said:
It seems like a simple question, but I am unable to find any succinct
answer
to this problem.

If I am provided a UNC, how can I convert it to it's absolute path on the
remote machine.

For example, machine MyServerA has a share created on a folder
c:\stuff\photos and it is called "SharedPhotos".

What code is required so that when executed on machine MyServerB, given
the
UNC \\MyServerA\SharedPhotos, I will get a result of c:\stuff\photos?


I am using the 2.0 framework, so if there are any new classes that I can
leverage with this release, then feel free to enlighten me.

Given that I will not have any credentials provided outside the current
WindowsIdentity of the user logged into MyServerB, will there be any
permission issues when executing the code?

Thanks in advance for any help.

Off the top of my head I'm not sure this kind of thing would be possible, as
it could conceivably be a security risk for machine A. The information will
be somewhere on A of course (you can see all of them in Manage My Computer,
System Tools, Shared Folders, Shares. You might find this is available via
WMI but again, you'd need the relevant permissions on machine A to get this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top