i was trying to write a batch file that installs a program, and when there is an error return the error level - except when it has errorlevel 3010
@echo off
:SP2
Start /wait C:\SQLInstall\SP2\SQLServer2005SP2-KB921896-x86-ENU.exe /quiet /allinstances
IF (%ERRORLEVEL% == 0) goto OK
else IF (%ERRORLEVEL% == 3010) goto Restart
else goto ERROR_SP2Install
K
echo SP2 Installation finished.
echo Log file for SQL 2005 SP2:
echo C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\Log\Hotfix\Summary.txt
echo.
:Restart
echo SP2 Installation finished. Restart required.
echo Log file for SQL 2005 SP2:
echo C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\Log\Hotfix\Summary.txt
echo.
: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?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic