I am using a Windows Script Host distribution package in Landesk to run a VBScript which performs several different tasks when executed. I have written the script in such a way that I can receive a status back at various points to determine if the script is executing as expected. If at any point something is failing I exit the script using the wscript.quit method. I would like to be able to get some status back to the Landesk console to report the error. If I quit the script and specify an exit code ( e.g. wscript.quit(1) ) I will get an error message. Here are a few of the errors that correspond to different exit codes:
wscript.quit(1) = Incorrect function.
wscript.quit(2) = The system cannot find the file specified.
wscript.quit(3) = The system cannot find the path specified.
wscript.quit(4) = The system cannot open the file.
What I would like is to be able to get a custom result message back in the Landesk console instead of the standard ones I mentioned above if the script errors out. Is there any way to accomplish this or is there another method that works better when running WSH packages?
Thanks in advance.