Archive: Get Return Value of vb-script


Get Return Value of vb-script
Hello,
I wrote an vbs file that contains something like that:

if (statement)
Wscript.quit(1) /*error*
else
Wscript.quit(0) /*no error*

Now I want to run the script with Nsis:
ExecShell "open" "test.vbs"

The script is running and when I put a MsgBox before the quits I can see the script itself is running well, but the return value NSIS gets is always 0, though it should be 1 sometimes too.
Is there a way to let my script return an error for NSIS?


You have to use ExecWait on cscript (ExecWait's optional parameter is to receive an exit code).

Stu


I suggest that you write a REG_DWORD value using VBS at the end of the VBS file according the the returned value, may be 0x00000000 or 0x00000001. After it exit, you can firstly read this value by NSIS, and then delete it.