How to create multiple folders and name them by reading lines from text file?



When it comes to managing data, IT admins often need to quickly create multiple folders and name them in an organized and efficient manner. While it’s easy to create one folder at a time, doing so for multiple folders can be tedious and time consuming. Fortunately, there is a way to create multiple folders and name them by reading lines from a text file.

The first step in creating multiple folders and naming them is to create a text file containing the list of desired folder names. This text file should contain one folder name per line in the desired order. It is important to remember that the folder names should not contain any non-alphanumeric characters since these are not supported by Windows. It is also important to make sure that the file is saved as plain text. After creating the text file, the next step is to open the Command Prompt. This can be done by typing “cmd” into the search box of the Start Menu.

Once the Command Prompt is open, the next step is to navigate to the desired folder location. This can be done by using the command “cd” followed by the folder path. It is important to note that paths should be surrounded by quotation marks if there are any spaces in the path. After navigating to the desired folder location, the next step is to enter the command “for /f %i in (filenames.txt) do md “%i””. This command will create a folder for each line in the text file.

The command “for /f %i in (filenames.txt) do md “%i”” can also be used to create multiple subfolders in an existing folder. To do this, the command should be entered while in the desired parent folder. The command will then create a subfolder for each line in the text file. It is important to note that the name of the text file should be changed appropriately in the command.

After entering the command, the folders and subfolders should be immediately created in the desired location. It is important to remember that the text file should be properly formatted and saved as plain text before entering the command. This is the most efficient way to create multiple folders and name them by reading lines from a text file. Doing so can save IT admins a lot of time and effort when managing data.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo