How to create multiple folders using a batch script

Brian C. Eam
2 min readMar 17, 2020

While studying as an undergraduate, often find myself misplacing many of my hard copy assignments, especially during crucial moments when I need them most to review for an important upcoming exam. I decided to become more organized, I created digital backups of all my assignments by scanning them into PDF files, and storing them into a folder on my PC.

One day, I noticed how time consuming it is to manually create folders individually. I wondered is there a faster, less cumbersome, and more automated method to create folders? Batch Scripting.

Batch Script: is an executable command of instructions that is stored within a text file.

Step 1: Create a Notepad text file

Here we need to tell the system to create five folders with the names: 1, 2, 3, 4, 5. To do this, the code we will type into the txt file is “md 1 2 3 4 5”.

Since I am using a Windows PC, the command I use to create a folder is “md”, which means “make directory”.

Step 2: Change the file extension from txt to bat

Here we change the file extension since we want to execute a batch script program to create multiple folders. If we do not change the extension, the file will just be a simple text file document.

Step 3: Execute the bat file

After double clicking the bat file, the five folders we wanted to create, should now be displayed on our screen. We did it.

Notably, this is just one of many instances Batch Scripting can be utilized.

Thanks for reading.

Portfolio: https://www.linkedin.com/in/brianceam

--

--