return values of WSCRIPT.EXE and CSCRIPT.EXE 
Author Message
 return values of WSCRIPT.EXE and CSCRIPT.EXE

As we are calling customized Scripts  using scripting host Wscript.Exe
from an external application, we are interested in the result (return
value) coming back from the scripting host.

After testing and playing around a little bit I would think that at
least the following return values could be defined:
    0:    script terminated normally
    3:    scriptfile does not exist

I could not find any return codes for CSript.Exe and WScript.Exe in the
online documentation.
Does anybody know where these codes are documented ?



Mon, 05 Mar 2001 03:00:00 GMT  
 return values of WSCRIPT.EXE and CSCRIPT.EXE
I don't know where they're documented, but unlike you, I have the source
code.  :-)

There are only two return values that I am aware of -- zero and one.

The main routine returns EXIT_FAILURE (1) under the following conditions:

* wrong version of Windows
* bad or missing file name
* unable to initialize COM or various data structures
* unable to load or save user settings from registry
* unable to understand command line
* asked to display usage
* script execution fails for any reason

Otherwise, EXIT_SUCCESS (0) is returned.  I don't know where you're getting
this "3" from -- perhaps I'm missing a case here, or perhaps that's from an
older version of WSH, or perhaps you're mistaken.  Hard to say.

Eric

Quote:

>As we are calling customized Scripts  using scripting host Wscript.Exe
>from an external application, we are interested in the result (return
>value) coming back from the scripting host.

>After testing and playing around a little bit I would think that at
>least the following return values could be defined:
>    0:    script terminated normally
>    3:    scriptfile does not exist

>I could not find any return codes for CSript.Exe and WScript.Exe in the
>online documentation.
>Does anybody know where these codes are documented ?



Mon, 05 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Running cscript.exe and wscript.exe from the floppy drive

2. cscript.exe vs wscript.exe

3. How to set the return value from cscript.exe

4. ADP errors not setting return code from cscript.exe

5. return value from VB exe

6. getting return value from spawned cmd.exe?

7. Returning values from API calls via Rundll.exe

8. WScript.Quit is not terminating wscript.exe

9. Cscript.exe and response.redirect

10. cscript.exe

11. Cscript.exe and script engine

12. how to run vbs from asp (via cscript.exe)

 

 
Powered by phpBB® Forum Software