All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
@echo off
SET count=01
GOTO LOOP
:ACTION
pkunzip CLSOTB%count%.ZIP
%count%+1
echo COUNT = %count%
GOTO :LOOP
:LOOP
IF EXIST CLSOTB%count%.ZIP GOTO ACTION
The line %count%+1 in ACTION is wrong. I've tried several other things, tried googling, but couldn't find anything that'd make it work. Does anybody here know?
AFAIK you can't do it in a simple way. I think you can use the utility CHOICE to do it but it's not pretty, requiring the /C option, redirection, errorlevels, IFs, and string appending. It gets nastier if your target doesn't support using %ERRORLEVEL% as a string. Windows XP doesn't come with the program but the version that comes with Windows 98 works on it fine. I'll see if I can come up with something definitive unless you decide you want to write a full program to do this instead.
You didn't specify the specific target OS which matters if you want to use FOR..LOOP. This is what I've got for systems that support using %ERRORLEVEL% as a string, untested:
@echo off
set digit1=0
set digit0=1
:mainloop
if not exist CLSOTB%digit1%%digit0%.ZIP goto end
pkunzip CLSOTB%digit1%%digit0%.ZIP
if not %digit0%==9 goto incrementdigit0
set digit0=0
goto incrementdigit1
:incrementdigit0
echo %digit0%>%TEMP%\t
choice/c:012345678/n<%TEMP%\t
set digit0=%ERRORLEVEL%
goto doneincrementing
:incrementdigit1
if %digit1%=9 goto end
echo %digit1%>%TEMP%\t
choice/c:012345678/n<%TEMP%\t
set digit1=%ERRORLEVEL%
:doneincrementing
echo COUNT = %digit1%%digit0%
goto mainloop
:end
del %TEMP%\t
set digit1=
set digit0=
It uses CHOICE to create a digit mapping that is consistent with incrementing, i.e. 0->1, 1->2,...,8->9. Before incrementing a digit it checks if it's 9 and if it is it makes it 0 and increments the second digit. There's no way to make a 9->0 mapping so you can't check for rollover after incrementing each digit and make it cleaner than the other way, the check must be done before it. For systems that don't support using %ERRORLEVEL% as a string you need to use an IF chain with descending values to make the appropriate digit variable equal to %ERRORLEVEL%.