10-24-2008 04:10 AM
Hi
I try find the universal path name for a Windows drive letter. This especially for a network drive but a general solution for also local drives would be ideal.
That is
I enter "N:RemoteVol/Foo"
and get "//Remoteserver/RemoteVol/Foo"
Or at least N: -> //Remotesever
Bets would be also something like
C: -> //Mycomputer/C/
I know that Windows has a way to map/unmap drive letters via the command line: "net use" But the returned information is verbose and language specific.
Since I cannot control whether the system the program will run on is a German or an English version (e.g..) I am looking for a nor universal solution.
Does anybody have an idea ?
Gabi
10-24-2008 09:45 AM
Hello Gabi,
I was looking in an old MSDN (2001) version and found that such things are done using the Windows Networking functions. It seems that the functions WNetOpenEnum, WNetEnumResource and WNetCloseEnum are the ones you are looking for.
Searching the online version I found this article (Link points to the german page but from your name I think you can read it).