Check output of a command for success criteria

(imported topic written by SystemAdmin)

Is there a way I can determine my success criteria on the output txt of a cmd command?

I would like to verify the last line of the txt file created = “Exiting with code:0”

waithidden cmd.exe /c __download\filename.vbs > output.txt

(imported comment written by BenKus)

If you run it from the command line, it displays the message “Exiting with code:0”?

You can run the command like you wrote it and then add a line:

continue if {line of file “output.txt” = “Exiting with code:0”}

(make sure the spaces and case of the message is correct).

Ben

(imported comment written by SystemAdmin)

Thanks Ben.

I want this to be part of the success criteria as this is then only command this task will run. Do I need to add the line number as follows?

{line 32 of file “output.txt” = “Exiting with code:0”}

(imported comment written by jessewk)

You can do that. You might also change the VB script to set a success flag on completion that’s easier to access, like a registry key.

In 8.0 you will be able to branch based on exit codes in action script.

(imported comment written by MattBoyd)

jessewk

In 8.0 you will be able to branch based on exit codes in action script.

THANK YOU THANK YOU THANK YOU!!!