bat file to create multiple folders

August 22, 2011 at 17:51:09
Specs: Windows 7 Home Preminum, 2.7 quad
I had a BAT to create multiple folders and all I had to do was put in the STARTING folder number and Ending NUMBER and tell it how many ZEROS to pad (01, or 001, or 0001, etc)
I could also enter a "prefix" like "sets"
I could specify the DRIVE and/or CD to the folder to create the sub-folders in.
It would LOOP and compare until all the folders were created
but i lost it with too many Windows system crashes and reloads.

Anyone have one or can someone review mine "attempt" to recreate?
The problem I am having is defining a NUMBER, adding to it or defining TEXT, etc.


See More: bat file to create multiple folders

Report •


#1
August 24, 2011 at 16:59:49
I'm working on it now, you'll have a code soon,
RMT2

Mouse could not be found. Click OK to continue.
What to do now?


Report •

#2
August 24, 2011 at 17:26:03
Okay, here is what I have. It will make up to 999,999 folders, and it is slow if you only have it making 1 or 2. Try it out and see how you like it:

@ECHO OFF
:START
ECHO Please enter a starting number:
SET STARTNUM=
SET /P STARTNUM=
CLS
ECHO Please enter an ending number:
SET ENDNUM=
SET /P ENDNUM=
CLS
ECHO Please specify the destination drive letter for folders to be created in:
SET CHOOFOL=
SET /P CHOOFOL=
%CHOOFOL%:
CLS
ECHO Please enter the number of folders you specified to be created:
SET NUMFOL=
SET /P NUMFOL=
SET /A NUMFOL=%NUMFOL%
ECHO Do you want to continue? y/n
SET CHOICE=
SET /P CHOICE=
IF CHOICE==n GOTO EXIT
CLS
GOTO MAKEFOLDER
:EXIT
EXIT
:MAKEFOLDER
ECHO Making folders...please wait.
:NEWNUM
SET NUM=%RANDOM%
IF /I %NUM% GTR %ENDNUM% GOTO NEWNUM
IF /I %NUM% LSS %STARTNUM% GOTO NEWNUM
MD %NUM% > ERRORLOG.LOG
SET /A %NUMFOL%-1
IF %NUMFOL%==0 GOTO END
CLS
ECHO Made folder %NUM%.
ECHO.
GOTO MAKEFOLDER
:END
CLS
ECHO All folders created. Now ready to exit.
PAUSE
EXIT

Mouse could not be found. Click OK to continue.
What to do now?


Report •

Related Solutions


Ask Question