Hi!
Is there a way to make a batch-script which makes you input the number of folders you want to make, then ask you for it's names and then generates them?
Ex:
How many folders?
3
Name of folder 1:
My Documents
Name of folder 2:
My Music
Name of folder 3:
My Pictures
Edit:
Or simply makes you make unlimited number of folders untill you input 'Done'?
Make folders with different names
Moderator: DosItHelp
Re: Make folders with different names
This is the basics of doing it. But really have to add in some error checking for valid input.
Code: Select all
@echo off
setlocal enabledelayedexpansion
set /p num=Enter Number of Folders:
for /L %%G in (1,1,%num%) do (
set /p folder=enter folder name:
mkdir "!folder!"
)
Re: Make folders with different names
Greetings Squashman!
That is a handy little script for quickly creating temp folders while testing code.
Hat tip!
That is a handy little script for quickly creating temp folders while testing code.
Hat tip!
Re: Make folders with different names
You could use this and just press enter alone to end the loop:
Code: Select all
@echo off
:loop
set "folder="
set /p "folder=enter folder name: "
if defined folder (
mkdir "%folder%"
goto :loop
rem do not remove the rem
)
Re: Make folders with different names
Greetings foxidrive,
I just put my hat back on!
Clever use of REM and yes I did try to replace it. Fail.
Thank you for the script. That's two 'keepers' in one day for me.
Later.
I just put my hat back on!
Clever use of REM and yes I did try to replace it. Fail.
Thank you for the script. That's two 'keepers' in one day for me.
Later.
Re: Make folders with different names
It works wonders! I liked the two different ways of doing it, so thank you both