Gloubs Posted October 28, 2004 Posted October 28, 2004 Hi all ! I'm making a script to disconect a mapped network drive. the main action is done by a "net use" command like this : $ret1 = runwait(@comspec & " /c net use " & $drive & ": /delete /no") I'd like to check if the command ran well, so I'd like to know about the return codes of the net use command... Anyone has a tip ? Thanks !!
JSThePatriot Posted October 28, 2004 Posted October 28, 2004 (edited) I dont know much about net use, but I bet a quick google would tell you what you need to know. Edit: After googling myself I think the only way to figure out if it has been properly deleted is to check and see if the exists. I dont know how to do that but I hope it has been helpful to push you in that direction. JS Edited October 28, 2004 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
this-is-me Posted October 28, 2004 Posted October 28, 2004 Just use DriveMapDel in the unstable. Who else would I be?
nobby Posted October 29, 2004 Posted October 29, 2004 If you really wnat to use net use /delete, you could add the following to check. $var = DriveStatus($drive) MsgBox(4096,"Status",$var) You could also try a few scenarios and get the value of $rte1 I have tried 2 things, 1: run the script when a drive is not mapped, $rte1 value = 2 2: run the script when drive is mapped, delete successful $ret1 value = 0 Hope it helps CheersNobby
JSThePatriot Posted October 29, 2004 Posted October 29, 2004 Thanks nobby you took my suggestion and put some code behind it. I didnt know what code to use, so I didnt bother looking it up as I dont see the need I may have for that JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
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