Step 7IF Command - But I'm Greater Than You (2/2)
For those of us programmers, I know this seems like a simple task. Just do what all the other programming languages do!
Well hold your horses cowboy. Not so fast. A Batch file isn't just your regular ol' programming langage. Silly as it may seem, the "<" and ">" don't work with Batch files.
EQU - Equal - ==NEQ - Not EqualLSS - Less ThanGTR - Greater ThanLEQ - Less Than or Equal ToGEQ - Greater Than or Equal ToJust put these operands in place of the ==
Example:
IF 32 GTR 3 ECHO This Will Work
@ECHO OFFIF 32 GEQ 32 (ECHO 32 is Greater Than, or Equal to 32) ELSE (ECHO 32 is definitely Equal to 32)PAUSEIF 32 LSS 32 (ECHO 32 is Less Than 32? I think not.) ELSE (ECHO 32 is Not Less Than 32. End of story.)PAUSE
| « Previous Step | Download PDFView All Steps | Next Step » |

















































color 29
Echo Chose the right number or get PWNED!
SET /p doom1=
SET boom2=8
IF %doom1%NEQ%boom2% (
start http:/www.epicwinrar.com/
)
I tried this batch out but it didn't work. What did I do wrong?
color 29
Echo Chose the right number or get PWNED!
SET /p doom1=
SET boom2=8
IF %doom1% NEQ %boom2% (
start http:/www.wikipedia.org/
)
You didn't put spaces between %doom1%NEQ%boom2%
It should be %doom1% (SPACE) NEQ (SPACE) %boom2%