Batch number variable setter.
Posted
by eyefinity
on Stack Overflow
See other posts from Stack Overflow
or by eyefinity
Published on 2010-06-08T16:44:48Z
Indexed on
2010/06/08
16:52 UTC
Read the original article
Hit count: 300
I need help with this batch file I'm working on,
Basically everytime it does a task it should plus the variable %number% by one which works fine and all and then repeat over again doing a different task until its completed.
This is the code which it uses to repeat
I need a way of settings basically:
set svn=%svn%%number%
set svnlink=%svnlink%%number%
set svnfolder=%svnfolder%%number%
Instead I am using:
if %number%==1 (
set svn=%svn1%
set svnlink=%svnlink1%
set svnfolder=%svnfolder1%)
if %number%==2 (
set svn=%svn2%
set svnlink=%svnlink2%
set svnfolder=%svnfolder2%)
if %number%==3 (
set svn=%svn3%
set svnlink=%svnlink3%
set svnfolder=%svnfolder3%)
Which i really need to shorten as this goes up to number 20+
Is this possible? If you could help me, Thanks!
© Stack Overflow or respective owner