Solved

How to convert local path to UNC

Posted on 1998-06-10
3
1,066 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

21 Experts available now in Live!

Get 1:1 Help Now