PJThys Posted March 14, 2004 Posted March 14, 2004 (edited) Hi all, Unfortunatly, i got no answers, so I post it again Despite the description of the exit codes in the helpfile, the errorlevel read under windows 98 is always 0 (probably means script ran OK!) How to get the errorlevel read as 1 if the exitcode of the script = 1. Works under windows 2000 by reading %errorlevel% in batch file. Under Windows 98 %errorlevel% gives a syntax error, and errorlevel always returns 0. If this is by design (or M$ restriction), helpfile should state that exit-codes cannot be used under windows 98 thx Peter Edited April 4, 2004 by PJThys
jpm Posted April 4, 2004 Posted April 4, 2004 Trying againAs I understand (JON can confirm) the errorlevel from .bat cannot be returned by Win9x.When I did a global nonreg under all OS I found out this problem and There is no solution to solve it by return %errorlevel%.Usually I write a file with different name so I can check it on the return.I hope that help.
Nutster Posted April 11, 2004 Posted April 11, 2004 On Win98 %Errorlevel% has meaning within batch files, otherwise it is ignored. It is not passed out of Command.com . Sorry. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
Somerset Posted April 11, 2004 Posted April 11, 2004 i hope this helps. the syntax for command.com does return the error code for dos programs...Syntax: COMMAND [path] [device] [/Switches] path Directory (and drive) containing command.com. This must be specified unless command.com is in the root directory. device Device to use for command input and output. By default this is the keyboard and monitor. /P Makes the new Command Interpreter permanent. /E:x Sets the initial environment size [bytes]. x should be set between 256 and 32,768 bytes. The default is: 256 bytes. /L:y Internal buffers length [bytes]. y should be set between 128 and 1,024 bytes. The default is: ? This switch is only accepted if the Command Interpreter is permanent - ie. the /P switch must also be set. /U:z Input buffer length [bytes]. z should be set between 128 and 255 bytes. The default is: ? This switch is only accepted if the Command Interpreter is permanent - ie. the /P switch must also be set. /MSG Stores all error messages in memory. This switch is only accepted if the Command Interpreter is permanent - ie. the /P switch must also be set. /LOW Forces COMMAND to keep in low memory /Y Steps through the batch program specified by /C or /K /C command Executes command and exits. This must be the last switch on the command line. /K command Executes command and continues running. This must be the last switch on the command line. /F Forces a "Fail" response to the Command Interpreter's error handling routine query: "Abort, Retry, Fail?". /Z Causes the ERRORLEVEL number returned by external DOS commands to be appended to the command's output.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now