lyledg Posted February 1, 2008 Share Posted February 1, 2008 Guys I am trying to use the ShellExecuteWait function, and the example from the helpfile shown below works well and returns a meesage box stating the exit code of zero $val = ShellExecuteWait("Notepad.exe") ; script waits until Notepad closes MsgBox(0, "Program returned with exit code:", $val)oÝ÷ Øz0z÷«-ëwöƲ¶¶W°jÉèµú.Ö¬²0·¥£®¶sbb33c·fÂÒ6VÆÄWV7WFUvBgV÷C´æ÷FWBæVRgV÷C² £²67&BvG2VçFÂæ÷FWB6Æ÷6W0¤×6t&÷ÂgV÷Cµ&öw&Ò&WGW&æVBvFWB6öFS¢gV÷C²Âb33c·f All I get is a normal windows error, but no exit code. (See attached pic) The reason I need this exit code for no file found is that with the current app I am writing, I need to write meaningful messages to the event viewer...so in this case a "file not found" won't give me a exit code, but only a gui message How could I rectify this? Cheers Link to comment Share on other sites More sharing options...
weaponx Posted February 1, 2008 Share Posted February 1, 2008 $val = ShellExecuteWait("Notepad.ee") ; script waits until Notepad closes MsgBox(0, "Program returned with exit code:", @ERROR) Link to comment Share on other sites More sharing options...
MHz Posted February 1, 2008 Share Posted February 1, 2008 All I get is a normal windows error, but no exit code.You need a file to run to get an exitcode from it. As weaponx shows, @error can silently pick up the error instead of the msgbox if RunErrorsFatal Opt is set off (apparently latest beta has it off as default). Link to comment Share on other sites More sharing options...
lyledg Posted February 1, 2008 Author Share Posted February 1, 2008 Thanks for putting me onto the right track mate Link to comment Share on other sites More sharing options...
lyledg Posted February 1, 2008 Author Share Posted February 1, 2008 Thanks Mhz..I have a Include file (See attahced which can give the exit code) I compiled this not long ago CheersExitcodes.au3 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