lyledg Posted October 9, 2007 Share Posted October 9, 2007 Hi guys I have been writing a script for launching in particular *.msi's, and although I was able to get error codes back, I was not getting a helpful description of the error, short from researching on the internet for it. So, I created this UDF that may come in handy which will provide a useful description of the error code returned from the Runwait command. (Note it only works with the Runwait command, not Run). I needed to write to the event viewer afterwards and having these handy descriptions helps pin point problems faster using the event viewer. The great thing is that you could add custom error descriptions and codes that are not listed in this UDF; that would be particular to a specifc program. An example of the script usage is included in the commented section of the UDF. Comments welcome... Cheers lyledgExitcodes.au3 Link to comment Share on other sites More sharing options...
Danny35d Posted October 9, 2007 Share Posted October 9, 2007 This is the one I use:Func _GetExitCode($iExitCode) Local $sLine = '' $Pid = Run(@ComSpec & " /c net helpmsg " & $iExitCode, @SystemDir, @SW_HIDE, 2) While 1 $sLine &= StdoutRead($Pid) If @error Then ExitLoop Wend Return(StringStripWS(StringStripCR($sLine), 3)) EndFunc AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
lyledg Posted October 9, 2007 Author Share Posted October 9, 2007 Yea, that 's cool! 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