:ERROR_SP2Install echo Error occurs when installating SQL server 2005 SP2. Error level: %ERRORLEVEL% echo Log file for SQL 2005 SP2: echo C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\Log\Hotfix\Summary.txt
however this doesnt works. Could anyone please help me to come up with a way that I can get the errorlevel when there is an error except when it was errorlevel 3010?
Hi Razor, Thanks for your help, and I have tried with your suggestion. In your suggestion it will always go to ERROR_SP2Install no matter what the errorlevel is, but my intension is going to ERROR_SP2Install only when there is a errorlevel > 0 and not 3010.
To illustrate clearer: Case 1: errorlevel = 0 then OK Case 2: errorlevel = 3010 then prompt for reboot Case 3: all other errorlevel then return the errorlevel value
is there anyway to do this, or if there is any Case command that i can use in Batch file?
Razor, I think an exe file always returns an errorlevel, although if it doesn't set it explicitly it may be random.
Since the original poster says that it always goes to ERROR_SP2Install, this means that his program is always returning an errorlevel other than 0 or 3010.
nic829, have you tried inserting echo %errorlevel% just before the goto commands that Razor gave you, to see exactly what error level you are getting?
Razor, I think an exe file always returns an errorlevel, although if it doesn't set it explicitly it may be random. You would think, but START is a built-in, and not an actual program. I seem to remember it doing some funky things with errorlevel, but I could be wrong.
The START/WAIT command is presumably there to pause the batch file until the executable it invokes returns. Otherwise, it will run the executable and the batch will continue running concurrently. When I tried it, START forwarded the errorlevel returned by the executable.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE