473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Convert UNC to local path on remote machine

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


Sep 28 '06 #1
2 7219
If you type \\MyServerA\SharedPhotos from MyServerB Windows Explorer and is
fine then it should be fine.

chanmm

"Ian Williamson" <Ia***********@discussions.microsoft.comwrote in message
news:4A**********************************@microsof t.com...
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


Sep 29 '06 #2

"Ian Williamson" <Ia***********@discussions.microsoft.comwrote in message
news:4A**********************************@microsof t.com...
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.
Sep 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DKode | last post by:
Ok, Maybe there is an easier way to do what it is im trying to do. Let me explain how I have the solution setup first. Basically, I am having alot of difficulty debugging on my local machine and...
1
by: mbailey | last post by:
Hello- I have a Sql Server 2000 database offsite that I would like to back up to a local machine. I am using Enterprise Manager on a local machine to administer the remote db. Whats the best...
6
by: Jim H | last post by:
I have an app I working on that was working fine a few days ago. Now I get a jscript error: Microsoft JScript runtime error: Object expected in a part of the code that has not been modifed or...
2
by: Hayato Iriumi | last post by:
Hello, I'm trying to find out a way to detect whether a path passed resides locally or on a remote machine. I can easily detect a path like \\machinename\path to be remote. But when it comes to...
8
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
2
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
1
by: lauralucas | last post by:
Hello I'm using ASP.NET 1.1, Visual Studio 2003, IIS 5.1 and windows XP as development machine. I can work in this machine locally and create web apps that I can access via localhost. No problem...
4
by: quincy451 | last post by:
I am running MS SQL 2000 server. The table involved is only about 10,000 records. But this is the behavior I am seeing. The local machine is querying the table looking for a particular record....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.