Page 1 of 1

Create folders in ascending order

Posted: 24 Nov 2013 06:40
by Danny
I want to create multiple folders inside a directory (i.e. Folder1, Folder2,...).
The folders will always be in ascending order starting from "000" and go up. (i.e. 000,001,002...)
Each time the script is run it will ask through a prompt stating "How many folders would you like to create">>
Hopefully this can be achived.

Re: Create folders in ascending order

Posted: 24 Nov 2013 07:13
by AiroNG
Something like that?

Code: Select all

@echo off
setlocal EnableDelayedExpansion
set /p count=How many folders?
for /L %%i in (1, 1, %count%) do (
 set "format=000000%%i"
 md folder!format:~-3!
)
goto :eof

Re: Create folders in ascending order

Posted: 24 Nov 2013 08:25
by Danny
Thanks AiroNG for response.
It works

Thanks