Lilla Posted May 14, 2004 Share Posted May 14, 2004 Windows XP Home SP1 AutoIt v3 build 101 pub 11Mar2004 How do I check exit code set by a .vbs The .vbs terminates with WScript.Quit(1) ;1=FAIL, 0=SUCCESS Method 1, doesn't work. RunWait('cscript.exe "chkdsk_ScheduleForNextRestart.vbs"') $errorlevel= ENVGET('ERRORLEVEL') Method 2, doesn't work RunWait('cscript.exe "chkdsk_ScheduleForNextRestart.vbs"') if @error then Method 3, doesn't work $errorlevel=RunWait('cscript.exe "chkdsk_ScheduleForNextRestart.vbs"') Question: What do I need to do to read the exit code set by a .vbs Thank you, Lilla Link to comment Share on other sites More sharing options...
Valik Posted May 14, 2004 Share Posted May 14, 2004 Method 3 should work. If not, then there must be some issue with how VB Script is returning. Link to comment Share on other sites More sharing options...
Lilla Posted May 15, 2004 Author Share Posted May 15, 2004 Valik & Larry. Thank you. Method 3 is working now. Not sure why it appeared not to be working before. And Larry, you are correct WScript.exe works. I switch to that now. Thanks for the tip. Lilla 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