Help Need with IF ERRORLEVEL

October 13, 2009 at 02:09:11
Specs: Windows XP
Help Needed on below

:start
cd\
cd tt
pslist \\192.168.48.85 tcon
IF ERRORLEVEL 0 goto:start
IF ERRORLEVEL 1 goto:Run
:Run
cd\
cd tt

Tab.exe

Keep getting same result for both errorlevels. dosent go beyond errorlevel 0


See More: Help Need with IF ERRORLEVEL

Report •


#1
October 13, 2009 at 03:03:58
Assuming the pslist command DOES set an ERRORLEVEL, the line IF ERRORLEVEL 0 will always return true - you need to check the levels in reverse order, highest to lowest, as the check is for "n or higher". Also not sure about your syntax.

IF ERRORLEVEL 1 GOTO run
GOTO start

should work.


Report •
Related Solutions


Ask Question