Solved

How to convert local path to UNC

Posted on 1998-06-10
3
1,088 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!
0
Comment
Question by:piano_boxer
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
vvk earned 50 total points
ID: 1407526
You can use function WNetGetConnection(drive,UNC,length) to get UNC name of specified connected device (disk or printer port).
0
 
LVL 23

Expert Comment

by:chensu
ID: 1407527
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.
0
 
LVL 4

Expert Comment

by:vvk
ID: 1407528
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.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studio Exe Issue, 12 28
VS2015 compilation and missing DLLs 9 147
Please explain "Promise Pattern" and how it's used 2 55
windbg taking it's time 32 90
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now