Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Return Code from VBS Called by .bat

Status
Not open for further replies.

thermidor

Programmer
Nov 28, 2001
123
US
Hi All,

I have a batch file that calls a VBscript file. I have an error handling routine in the .vbs and I want to get pass this value from the .vbs back to the batch file. Cna someone please explain how this can be accomplished?

TIA,
Sven
 
WScript.Quit yourErrorLevel

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the reply.
If I put WScript.Quit myErrorLevel in my vbs, how do I get that value in my batch? What I'm thinking is that I run my vbs with On Error Resume Next doing my error handling. Then I pass a return code to the batch. If the return code is not good then I take action in the batch...
 
By testing the ERRORLEVEL special register.
When in a command window type if /?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top