Please explain your problem fully. You haven't asked for help with anything.
@echo off
for /L %%a in (1,1,999) do (
set z=000%%a
call :makd
)
goto :eof:makd
set z=%z:~-3%
md %z%
:end
not tested.
More simply: :: ===== script starts here ===============
::
:: faiz.bat 2012-08-11 18:16:16.10
@echo off & setLocal enableDELAYedeXpansioNfor /L %%a in (1 1 999) do (
if %%a gtr 99 set N=%%a
if %%a lss 100 set N=0%%a
if %%a lss 10 set N=00%%a
echo MD !N!
)
::====== script ends here =================`
====================================
Life is too important to be taken seriously.M2
i want batch file one open create 001 2nd open create 002 open gain create 003
you batch file is one open cretae 001 to 999 i dont want this
Lol! Phill22 was right. should have waited for "the other shoe to drop". Oh well, only wasted about 3 minutes on that one anyway. This might work: @echo off & setlocal
for /f %%a in ('dir /o-n /b /ad | findstr /r "[0-9][0-9][0-9]"') do set last=%%a & goto :x
:why, in gods green earth, did MS have to make octal have leading zeros!!!!!
:they could have used ANY other friggin thing, but NOOOO! Who the h_ uses
:octal anyway? that went out with 8-bit processors, about 30 years ago.
:x
set test=%last:0,1%
if %test% equ 0 (
set last=%last:1%
goto :x
)
set /a last +=1
set last=000%last%
set last=%last:~-3%
md %last%
:---- end
i'm sucky with regexp, so that "findstr" might need some tuning.
why would you want 999 batch files to each create thier own instance of a md? seems like the opposite of simplifying, or perhaps I missed the intent... :: mike
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |