How to create multiple folders at once using a batch file

preview_player
Показать описание
How to create multiple folders at once using a batch file

Batch file commands (as used in this video):

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:

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.
Рекомендации по теме
Комментарии
Автор

That was so much simpler than I thought, thanks for the quick and concise tutorial!

XanderManCan
Автор

Thank you so much for this. By far the easiest route I've discovered!

ollyloosemore
Автор

This is great! So much quicker than going new folder>rename; new folder>rename.... etc. :)

LordSandwichII
Автор

Simple, easy, quick! Thank you for your help.

kirstenphelan
Автор

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!

curtjanus
Автор

Such a simple and easy one. Thanks Pal!!

amansoni
Автор

Thank u verrrry much!! saved me hours of work :)

sheetalramesh
Автор

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

pcruns
Автор

Thank you so much for this script. It will save me a lot of time.

kranthimo
Автор

tysm...one more request. If I want to give the main folder a name at runtime, how can I do that?

nexgen.graphics
Автор

how can I save individual files to individual folders in mass? For example all documents corresponding to one person saved to their employee file?

lizzetramirez
Автор

Do you have a video where you can ask for the main folder to be inputted by user via this batch command?

AshleyGlover
Автор

how do you do the same thing but instead of folders text files?

retrocat
Автор

*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*

chucktomahawk
Автор

Great job! Just a question. How can i add in name folders, characters with diactiric. thx, sir!

dariusperta
Автор

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.

alexman
Автор

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.

DavidRojasElbirt
Автор

I am unable to create multiple folders on Windows 8.1.Why? Maybe it works only on Windows 7?

WindowsLove
Автор

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...

nuritnovis
Автор

Hey, Please I want a batch file to rename multiple FOLDERS at the same time
se can you help me ? :D

spongbob