0

Trying solutions here and here works fine, except in Task Scheduler Last run result always shows as The operation completed successfully. (0x0) instead of 0x2 or 0x3 without vbs: 0x2

Is it possible to get exit codes with vbs script?

3
  • you probably need to catch them and set it yourself, and depends what you put in the script, the exit code of the script will be the last command executed, so if you have a set or echo or whatever, that will be recorded as result.
    – Zina
    Commented Dec 22, 2020 at 22:09
  • Ah ok. No idea how vbs works so hoping someone will have something to paste :)
    – lemeie
    Commented Dec 22, 2020 at 22:26
  • each command you run will return the errorlevel code, if successful 0 otherwise depending on the command, so you need to catch the errorlevel immediately after the command was run, with the notice that reading the errorlevel code will reset the errorlevel code to 0 as the command to get the errorlevel will always succeed...
    – Zina
    Commented Dec 22, 2020 at 22:56

0

You must log in to answer this question.

Browse other questions tagged .