Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: variable increment  (Read 3728 times)

0 Members and 1 Guest are viewing this topic.

Dorothy R

  • Guest
variable increment
« on: October 12, 2004, 01:14:52 PM »
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,
Dorothy

merlin_2

  • Guest
Re: variable increment
« Reply #1 on: October 12, 2004, 03:52:24 PM »

scruge

  • Guest
Re: variable increment
« Reply #2 on: October 23, 2004, 07:38:11 PM »
you 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.