lyledg Posted October 19, 2005 Share Posted October 19, 2005 I am currently writing a proggie for work which needs to detect the UNC Paths rather than the Drive letters that I am currently connected to, and then I need to add these paths to a list box. Is there a easy way to do this? Thanx Link to comment Share on other sites More sharing options...
/dev/null Posted October 19, 2005 Share Posted October 19, 2005 (edited) I am currently writing a proggie for work which needs to detect the UNC Paths rather than the Drive letters that I am currently connected to, and then I need to add these paths to a list box.Is there a easy way to do this?Thanx "net use" will print the mapped drives and the UNC names. Run "net use" with RunWait() and parse the output.EDIT: Even better, if you know the drive letter: "net use x:" will print the UNC path for the drive letter x:CheersKurt Edited October 19, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Holger Posted October 19, 2005 Share Posted October 19, 2005 (edited) Just like:? $drives = DriveGetDrive("network") If IsArray($drives) Then For $i = 1 To $drives[0] $unc = DriveMapGet($drives[$i]) Msgbox(0, $drives[$i], $unc) Next EndIf Regards Holger Edited October 19, 2005 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
/dev/null Posted October 19, 2005 Share Posted October 19, 2005 Just like:?$drives = DriveGetDrive("network") If IsArray($drives) Then For $i = 1 To $drives[0] $unc = DriveMapGet($drives[$i]) Msgbox(0, $drives[$i], $unc) Next EndIfRegardsHolgerWell, I really love to run commandline tools and to parse the output. I guess that's more like the unix way than the windows way to solve problems... CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
condoman Posted October 19, 2005 Share Posted October 19, 2005 I use this code to resolve the drive of a file. If DriveMapGet has an error then the file is local, if it is mapped the the drive is converted to UNC and if UNC alreday it stays like that. This allows me to email links to mapped files without having to edit out the drive and convert it to a server, which I do often. Hope it helps. It is from my Explorer CM3Utility context menu tool at: My AU3 Projects$Drive = StringLeft($CMDLINE[2], 2) $Msg = DriveMapGet($Drive) If @error = 0 Then $Msg = StringReplace($CMDLINE[2], $Drive, $Msg) Else $Msg = $CMDLINE[2] EndIf ClipPut($Msg) Link to comment Share on other sites More sharing options...
lyledg Posted October 19, 2005 Author Share Posted October 19, 2005 Thanks guys, all your answers helped me! Cheers Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now