Md 001 002 003

August 11, 2012 at 02:27:47
Specs: Windows XP
hi
folder creating 001 002 003 to 999

See More: Md 001 002 003

Report •


#1
August 11, 2012 at 05:06:52
Please explain your problem fully. You haven't asked for help with anything.

Report •

#2
August 11, 2012 at 19:22:32
@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.


Report •

#3
August 12, 2012 at 02:41:41
More simply:

:: ===== script starts here ===============
::
:: faiz.bat 2012-08-11 18:16:16.10
@echo off & setLocal enableDELAYedeXpansioN

for /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


Report •

Related Solutions

#4
August 14, 2012 at 03:32:33
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

Report •

#5
August 14, 2012 at 18:44:10
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.


Report •

#6
August 25, 2012 at 19:26:45
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


Report •

#7
August 25, 2012 at 20:23:21
"" I'm glad it not just me"" Lol! M2go, lots of us in the same boat!

Report •


Ask Question