I am tring to run a command line application and get its return value. I have no difficulty in running the application, but if it fails to run the program says it returns values as to why it failed.
I have found the script that kills the process after so long so it can begin processing again and that works fine. However, with these return values a better form of error trapping could be done.
Example of return values
4606 Unable to open file. Check file name and permissions.
4662 Unable to read file due to disk or network error.
Naturally there are many more. Is there a way for MS to get these values?
If I use the RP_Result it returns 33 which means it is sucessful; however, even if the program was run sucessfully doesn't mean the process was sucessful from the program.
Getting Return value from Command line application
Moderators: JRL, Dorian (MJT support)
If the command line return values are showing in the DOS window, you mifgr be able to redirect the text to a file. The redirect symbol is ">" to create a file or ">>" to append to a file.
For example:
dir > result.txt
will put the dir output into a file "result.txt" rather than displaying it on the screen.
For example:
dir > result.txt
will put the dir output into a file "result.txt" rather than displaying it on the screen.
Return Values
No, they are not available from dos. I just tried what you mentioned and there is no value displayed on the screen and with the directing it to the file, the file is created with no value.
I quess it must be done through VBScript or something else.
I quess it must be done through VBScript or something else.
The verbose option might be a possibility, or some other switch that forces the errors to be displayed or written. Or it might be already writing the info to a file. Look in the app's folder or the temp folder to see if any files are being updated when you crash the app.
Can you divulge the name of the application?
Can you divulge the name of the application?
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
There's some kind of error code written to the registry too:
%ERRORLEVEL% - Returns the error code of the most recently used command. A non zero value usually indicates an error.
More details here.
%ERRORLEVEL% - Returns the error code of the most recently used command. A non zero value usually indicates an error.
More details here.