One way is to create each folder one by one and then rename them again one at a time. This method would be fine if you had to create only a few folders. But what if you need to create several such folders. Doing it using the above method would be quite tedious and time consuming.
Here’s a little command prompt trick that can help you immensely.
- Open Notepad and type in a list of the names of the folders you need to create, with each name in a separate line.
- Save this file in the folder in which you want to create the sub-folders. This will save you the trouble of having to type out the entire path. Let’s call this file folders.txt.
- Open a command prompt in that folder and type:
FOR /F %n IN (folders.txt) DO MKDIR %n
and hit Enter. Within seconds the folder would all be created.
You can use any single letter instead of n, and the command will take each line of the file and DO a MKDIR with the name it finds.
A variant is to use:
FOR /F “tokens=*” %n IN (folders.txt) DO MKDIR %n
This version will process items on the same line, separated by spaces. To create folders with a space in the name, use the second method and enclose the name in double quotes. So, for example, a text file containing the line
“January February” March April May
will produce four folders when fed to the FOR command, the first being named “January February” and the others named March, April and May.