Sign in to follow this  
Followers 0
Lilla

How Do I Check The Exit Code Set By A .vbs

3 posts in this topic

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

Share this post


Link to post
Share on other sites



Method 3 should work. If not, then there must be some issue with how VB Script is returning.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0