Jump to content

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


Recommended Posts

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...