okysPPanda
Technical User
What I am trying to do is create a sript that will take an input value in the form of a number, and then copy "1.exe" with the input number as the name. Then I want it to subtract one from the input number and repeat the process, creating many #.exe files, all identical except for the name. Finally, I want to be able to stop the process when the file 0.exe is created.
I need this file to work for Windows 2000, but would like it to work with other versions of Windows too.
The following is what I have come up with so far. I am getting an error when it reaches "if /i %abc% LSS %1 goto END" the process stops and says 0 was unexpected at this time.
set [[/a [%1 GTR 999]] [/p [abc=%1]] goto ER2]
set [[/a [%1 LSS 1]] [/p [abc=%1]] goto ER2]
:N2
copy 1.exe c:\winnt\%abc%.exe
set /a %abc% "-=" 1
set [[/a [%1 GTR 1]] [/p [%abc%-=1]] goto N2]
if /i %abc% LSS %1 goto END
goto N2
:ER2
echo You must specify a number >0 and <1000, as in "1" or "999"
:END
If anyone could show me what I am doing wrong, or possibly show me an easier way to do this, it would be much appreciated.
I need this file to work for Windows 2000, but would like it to work with other versions of Windows too.
The following is what I have come up with so far. I am getting an error when it reaches "if /i %abc% LSS %1 goto END" the process stops and says 0 was unexpected at this time.
set [[/a [%1 GTR 999]] [/p [abc=%1]] goto ER2]
set [[/a [%1 LSS 1]] [/p [abc=%1]] goto ER2]
:N2
copy 1.exe c:\winnt\%abc%.exe
set /a %abc% "-=" 1
set [[/a [%1 GTR 1]] [/p [%abc%-=1]] goto N2]
if /i %abc% LSS %1 goto END
goto N2
:ER2
echo You must specify a number >0 and <1000, as in "1" or "999"
:END
If anyone could show me what I am doing wrong, or possibly show me an easier way to do this, it would be much appreciated.