How to create multiple folders at once using a batch file
Vložit
- čas přidán 24. 09. 2015
- How to create multiple folders at once using a batch file
Batch file commands (as used in this video):
"@echo off
md images videos articles\pages articles\posts"
You can also use 'mkdir' instead of 'md'; both commands do exactly the same. To make folders with spaces in the folder name, use quotation marks. Example:
md "Folder\Folder Name"
#batchfile #batch
Follow me on other media:
►Website: www.guidoshowtos.com
►Facebook: / guidoshowtos
►Twitter: / guidoshowtos
Full instructions:
First, create a batch file. Right-click,’New’, ‘Text document’, give it a name, and give it the .bat file extension.
Click 'Yes'.
Now right-click your file, and click 'edit'.
Start the batch file with @echo off. This will prevent the commands from showing on screen when running the batch file.
Now type ‘md’, which means ‘make directory’. This is the command for creating a folder.
Then type a space, and the name of the folder you want to create.
To create multiple folders at once, separate them with a space.
To create a folder with a subfolder, type the name of the folder, then use the backslash (\), followed by the name of the subfolder.
When you're done typing the names of the folders you want to create, click 'File' and, 'Save', and close the batch file.
Double-click on your batch file to run it.
And, it works! As you can see, it created all the folders I wanted to create, including this folder, with two subfolders. - Věda a technologie
Thank you so much for this. By far the easiest route I've discovered!
That was so much simpler than I thought, thanks for the quick and concise tutorial!
Simple, easy, quick! Thank you for your help.
Great!!! Just saved me hours, I'm sure. Btw "Folder\Folder Name" for folders with spaces in their names. AND Folder\SubFolder1 Folder\SubFolder2 works.
Thank you Guido,,, although you don't sound like any Guido I've ever met! haha!
+Curt Janus Awesome! Will add the info about using quotation marks to the description.
So did you expect an Italian-American stereotype accent? Sadly, that's all my first name is associated with these days.
Such a simple and easy one. Thanks Pal!!
This is great! So much quicker than going new folder>rename; new folder>rename.... etc. :)
clean and direct. thank you. useful.
Thank u verrrry much!! saved me hours of work :)
This is great. Thank you so much!
Legend, Thank you for your help!
Wow that's amazing THANKS!
BRILLIANT! thanks buddy
Hi Guido's How-to's,
Thanks for the bat file videos, they've already helped a lot.
A client had music, docs, etc. all over his computer and I've used your bat file to move different file types into perspective folders.
I was wondering though on if and how to make a bat file that would organize many individual music files into artist/album folders.
I client has hundreds of individual tracks in the "Music" folder not separated into Artist/Album folders and it would make a lot more sense if it the individual tracks were separated into folders by Artist/Album.
Is there a way to make a bat file that would do this?
Could you please make a video on how to make this bat file and let me know if it can be done and when you've done it, if it can be done.
Anyhow, I think you get what I mean. Thanks!!!
John
Awesome!!!!! It worked very well. Thank you!
Thank you very much for your tip
Do you have a video where you can ask for the main folder to be inputted by user via this batch command?
Thank you so much for this script. It will save me a lot of time.
tysm...one more request. If I want to give the main folder a name at runtime, how can I do that?
how can I save individual files to individual folders in mass? For example all documents corresponding to one person saved to their employee file?
nice. . for more nice creation and Windows customization, google FolderChanger
k
Great job! Just a question. How can i add in name folders, characters with diactiric. thx, sir!
*now how would i do this with a program*
*see what Im trying to do is open mutiple vbs scripts at once*
*but it will only open one at a time*
*PLZ HALP*
how do you do the same thing but instead of folders text files?
Is there a way to create multiple subdirectories in one subdirectory? When I try, it ends up making a subdirectory inside the subdirectory inside the main.
Hey, Please I want a batch file to rename multiple FOLDERS at the same time
se can you help me ? :D
Sadly this approach did not handle áccéntéd vówéls well. Is there a workaround? But otherwise, a very easy approach! Also, say, I wanted to batch make a bunch of folders and place them all in one subfolder. How would I do that? Thanks.
what is the easiest way to put an array of folder names into multiple folders
is there a way to create also files with different extensions inside different folders? I need to create .docx, .xlsx, .pdf, .jpeg, with specific names, that can later be replaced with files with real content. I have to do this by hand everytime. I do repetitive tasks that generate the same folders and files each time, just varying in the parent file a sequential number.
not sure about file in sub folders but in the main folder i do this: copy NUL "File Notes.docx"
Hi, this looks like a wonderful method and I'd love to try it but when I do, my computer says I don't have an app to run the bat file. Any ideas? Windows 10...
wait... I figured out what I did wrong and corrected it ("edit" not "open") and now it works like a charm. Thanks so much!!
I am unable to create multiple folders on Windows 8.1.Why? Maybe it works only on Windows 7?
+Windows Love As far as I know, batch files should work exactly the same on any Windows version.
Have you tried running the batch file as administrator? Right-click on the file, then click on 'Run as administrator'.
how to add .txt file with text in folder ?
You're clutch
I don't think this works for Windows 10, I did 'md foldertest\folderA Folderb' and it did foldertest fine with folderA as a subfolder but folderB is on the outside of foldertest.
Looks like you'd need to do 'md foldertest\folderA foldertest\folder B' to get it to all be within the same folder. Otherwise it will make a new folder called 'Folderb' just in the original directory where your batch file is stored.
Is there a easy way to create multiple dynamically named subfolders (for example 20 subfolders beginnig at m1 till m20 ), something like md m01 to m20
Yes, run a for loop that ads to a number every loop and use that number in your file name like this
Not the whole script but that's the idea
how to make it in a different directory:
cd\
cd (Folder you want thats in your computer)
md INSERT_FILE_NAME\INSERT_SUBDIR_NAME
but mine remains as text document even after i made name with .bat
Try going into the settings of your file explorer and unhiding file extensions.
what if there's a space in the name of teh folder ?
ex:- "New Folder"
just put in into inverted commas
what if you want to make folder name with space?
Use double quotation marks for the name (for example: "Example folder"), and it should work!
done everything my shit dnt wrk. my cpu is alive and dnt want me to direct it lol. I haave a rampage 3 extreme ought to see thew bugs this thing has but is a beast
im getting errors
ummmm im in 2020