Computing.Net > Forums > Windows XP > Help Need with IF ERRORLEVEL

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help Need with IF ERRORLEVEL

Reply to Message Icon

Name: gha1d
Date: October 13, 2009 at 02:09:11 Pacific
OS: Windows XP
Subcategory: General
Tags: Batch programing
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Rambler
Date: October 13, 2009 at 03:03:58 Pacific
Reply:

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.


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Help Need with IF ERRORLEVEL

Help needed with dual monitors www.computing.net/answers/windows-xp/help-needed-with-dual-monitors/91545.html

HELP NEEDED WITH EASY CD CREATOR 5.0 PLA www.computing.net/answers/windows-xp/help-needed-with-easy-cd-creator-50-pla/11648.html

XP Pro - IIS - Help Needed www.computing.net/answers/windows-xp/xp-pro-iis-help-needed/90262.html