Creating dozens or hundreds of folders manually can be an incredibly tedious task. Fortunately, if you have the folder names listed in an Excel spreadsheet, there’s a clever way to automate the process using a batch file. This method works whether you’re using Excel on desktop, Excel Online, or even Google Sheets. Let’s walk through how to generate multiple folders at once from your spreadsheet data.
Step 1: Open your Excel spreadsheet containing the list of folder names you want to create. It’s a good idea to make a copy of your original file before proceeding, as we’ll be making some modifications.
Step 2: Insert a new column at the beginning of your spreadsheet. Right-click on the header of column A and select “Insert” from the context menu.
Step 3: In this new column A, type “MD” (which stands for “Make Directory”) in every cell next to your folder names. You can quickly fill the column by typing “MD” in the first cell, then double-clicking the fill handle (the small square in the bottom-right corner of the cell) to auto-fill the rest of the column.
Step 4: If you want to create subfolders, add a backslash (\) as a prefix to the cells in columns C, D, and so on. These will represent your subfolder structure. For the main folders in column B, leave them as-is without a backslash.
Step 5: Select all the cells containing your folder structure data (including the “MD” column). Copy this data to your clipboard.
Step 6: Open Notepad on your computer. You can do this by pressing Windows key + R, typing “notepad”, and hitting Enter.
Step 7: Paste the copied Excel data into Notepad. You’ll notice there are spaces between the columns. We need to remove the space between the main folder names (column B) and the subfolders (columns C and onward).
Step 8: To remove these spaces efficiently, use Notepad’s Replace function:
- Press Ctrl + H to open the Replace dialog.
- In the “Find what” box, type a space followed by a backslash: ” \”
- In the “Replace with” box, type just a backslash: “\”
- Click “Replace All”
Step 9: Now that the spaces are removed, we need to save this file as a batch file:
- Go to File > Save As
- Choose the location where you want to save the file
- Set the “Save as type” dropdown to “All Files (*.*)”
- Name your file with a .bat extension, for example “create_folders.bat”
- Click Save
Step 10: Move the newly created .bat file to the location where you want your folders to be created.
Step 11: Double-click the .bat file to run it. Windows will execute the commands, creating all your folders and subfolders based on your Excel data.
Depending on how many folders you’re creating, this process may take a few seconds to complete. Once finished, you’ll have all your folders neatly organized according to your spreadsheet structure.
This method can save you hours of manual folder creation, especially for large projects or complex folder structures. Just remember to double-check your spreadsheet data before running the batch file to ensure all folders are created correctly.