Batch file

  • Thread starter Thread starter PARVIZ
  • Start date Start date
P

PARVIZ

I would like to design a batch file and i know using
the 'equal' sign "==" but I need to use 'greater than'
or 'less than' signs "< or >".
Please tell me ,How can I do this?

for example
IF %USERNAME% > 00 AND %USERNAME% < 10 THEN
SET UNIT=1
 
PARVIZ said:
I would like to design a batch file and i know using
the 'equal' sign "==" but I need to use 'greater than'
or 'less than' signs "< or >".
Please tell me ,How can I do this?

for example
IF %USERNAME% > 00 AND %USERNAME% < 10 THEN
SET UNIT=1

At a Command Prompt you can type

if /?

to see the full syntax for the "if" statement. It goes over
several pages. The operators you're looking for are LSS,
LEQ, GTR and GEQ.

Also: there is no AND operator in batch files. Replace it with
another "if". And lastly: omit the "then" word after "10".
 
Back
Top