We help IT Professionals succeed at work.

How to convert local path to UNC

piano_boxer
piano_boxer asked
on
Medium Priority
1,137 Views
Last Modified: 2013-12-03
I need a function that can convert a local path (say 'z:\user\aa\info.zip') to its UNC-name ('\\server1\vol1\user\aa\info.zip').

NOTE: The function needs to work both on Windows 95 and NT4!
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
WNetGetConnection vvk suggested seems to not be what you are looking for.

On Windows NT, you can use WNetGetUniversalName() function. On Windows 95, take a look at
http://support.microsoft.com/support/kb/articles/q131/4/16.asp.
vvk

Commented:
You cant get full path by executing WNetGetConnection by i think there is no problem to get it by appending a part of one string to another. And this function works both WinNT, Win95.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.