Tech Support > Microsoft Windows > Development Resources > Translate a network-mapped drive path to a UNC path
Translate a network-mapped drive path to a UNC path
Posted by R.Y. on November 8th, 2006


Hello guys:

I'm trying to find a way to translate a network-mapped drive path to a
UNC path. For example: W:\test.txt => \\Server\Share\test.txt

Any Win32 API to do this? Thanks in advance.

R.Y.

Posted by David Lowndes on November 8th, 2006


Have a look at WNetGetUniversalName.

Dave

Posted by R.Y. on November 8th, 2006


Cool! Thanks mate.

David Lowndes wrote:

Posted by R.Y. on November 10th, 2006


Sometimes I can call WNetGetUniversalName. But sometimes it just
returns ERROR_NOT_CONNECTED. All tests are done in a VMWare XP SP2 with
a mapped network drive from VMWare Shared Folders. Anyone has more
experience or suggestion about this topic?

David Lowndes wrote:

Posted by David Lowndes on November 10th, 2006




Any clue what "sometimes" give rise to the failure?

Is it reliable if you eliminate the VMWare shared folders?

Dave

Posted by R.Y. on November 10th, 2006


I can not see any special things when this failure comes out. At that
time the mapped drive is till accessible and the file can be accessed.

Since the mapped drive is from the VMWare Shared Folders, I can not
remove it.

David Lowndes wrote:

Posted by R.Y. on November 10th, 2006


Hello David, I tried a new mapped drive from a normal network PC. It
works well.

I'm not sure if this is the problem of VMWare Shared Folders. But I
remember before yesterday I could make the success calls with
WNetGetUniversalName on VMWare-share-folders drives. So weird....

David Lowndes wrote:

Posted by David Lowndes on November 10th, 2006


Good. I'd chalk that one up to some flakiness with VMware shared
folders then. I think I've seen other references to quirks using them.

Dave


Similar Posts