1.

Solve : variable increment?

Answer»

Hello!
Please help!
I am trying to increment a VARIABLE by 1.
This is what I do:
>>set VAR=2
>>echo %VAR%
2
>>set /A VAR=%VAR%+1
>>echo %VAR%
2
Why isn't the value of VAR 3?  How do I increment it?
I am using DOS with Windows ME.
I am trying to create a loop in a batch file
with IF ...  GOTO LABEL  that will execute a series of
commands 100 times, so I NEED to increment VAR until
VAR=100.  
Can someone help me?  
Thank you sooooooooooo MUCH,
Dorothyhttp://www.cknow.com/tutorcom/batch03_subcmd1.htmyou might want to take a closer look at expanded SET commands and using the !var!.  You'll also need to turn some of them on with the cmd /v command.



Discussion

No Comment Found