[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to convert local path to UNC

Posted on 1998-06-10
3
Medium Priority
?
1,126 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 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

834 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