IF cmd statements

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I have an IF statement that does not seem to be working
correctly. I am not sure what seems to be going on.

ECHO Report
:report
echo ERRORLEVEL=%ERRORLEVEL%
@if %ERRORLEVEL% GTR 0 GOTO unavail ELSE ECHO Available


goto end
REM ELSE ECHO "Server Unreachable"
:AVAIL
ECHO "Available"

:UNAVAIL
ECHO "Server Unreachable"

:END

Thanks for any help.

Matt
 
I have an IF statement that does not seem to be working
correctly. I am not sure what seems to be going on.

ECHO Report
:report
echo ERRORLEVEL=%ERRORLEVEL%
@if %ERRORLEVEL% GTR 0 GOTO unavail ELSE ECHO Available


goto end
REM ELSE ECHO "Server Unreachable"
:AVAIL
ECHO "Available"

:UNAVAIL
ECHO "Server Unreachable"

:END

Thanks for any help.

Matt


See tip 758 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top