?
Solved

How to convert local path to UNC

Posted on 1998-06-10
3
Medium Priority
?
1,119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
vvk earned 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

777 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