How to Create Folders from an Excel List in Windows

Turn a column of Excel folder names into folders in Windows. Prepare the list, generate commands, and check the destination before creating anything.

A person arranges colorful paper folders in a wooden box on a desk.
In this article

You can create folders from an Excel list by turning each folder name into a Windows command, then running the commands from a batch file. Put your names in Excel, generate one command for each name, and save the finished commands as a batch file in the location where you want the folders to appear. [1][2] You may also find this useful: How to Create Folders From a Text List in Windows.

This method is useful when you need to create many folders with names already organized in a spreadsheet, such as project folders for a team or folders for class assignments. The steps below show how the Excel list connects to the batch file, while keeping a test run and a name preview in the workflow.

Before you run anything, check the folder names and command lines in the batch file, then try them in a new, empty folder. For example, if your spreadsheet lists “Invoices” and “Receipts,” first confirm those are the folders you expect to create and test the commands in a separate location. Once the test looks right, use the same process for the intended parent folder. Learn more in How to Create Multiple Folders at Once in Windows.

Prepare your folder names in Excel first

Start with a clean, easy-to-check Excel list: use one folder name per row in a single column, remove blank rows and duplicates, and decide whether the names should create folders or nested paths. This preparation helps prevent unwanted entries from becoming folder names.

Arrange the names

Put each intended folder name in its own cell in one column, with no headings or other data mixed into the list. For example, a simple list might contain Invoices, Projects, and Receipts, one name per row. A single-column list is the recommended starting format for creating folders from Excel. [1][2]

Scan the column for blank rows and remove them, so empty cells do not become unintended entries. Also remove duplicate names if you only want one folder for each name; Excel’s Remove Duplicates feature can help you check the column. [2]

Choose a folder structure

Decide whether every folder should sit directly inside one parent folder or whether some should be nested. Excel-based methods can use cell values to create folders and subfolders. [3]

Check names and protect your workbook

Review each cell for characters Windows does not allow in folder names, such as /, :, or ?. Also look for accidental spaces at the beginning or end of a name and unexpected values that may have been copied into the column. Remove or correct anything that should not become part of a folder name.

Before you edit the list, save an unchanged copy of the workbook so you can recover the original names if needed. Choose a separate, easy-to-find test destination for the first attempt rather than using a folder that already contains important files. A parent folder is commonly used as the location for the new folders. [1]

A laptop displays a tidy spreadsheet with one proposed folder name in each row, ready for organizing.

Turn each Excel row into a folder command

  1. Add a second column beside your folder names. In the first cell beside a name, enter a formula that joins the Windows MD command with the cell containing that name; for example, if the name is in A2, use ="MD """&A2&"""" to generate a line such as MD "Reports". The quotes keep a name that contains spaces, such as Tax Records, together as one folder; without them, MD would create two folders, Tax and Records. [2]

  2. Fill the formula down alongside the list. Each row should produce one command line, with the folder name from that row following MD. Inspect the completed lines for missing names, leftover formula errors, or text that does not belong in a command before copying them. [2]

  3. For nested folders, put the parent and subfolder in the same cell with a backslash between them, such as Projects\April, then generate the command from that cell. The resulting line is MD "Projects\April"; this format lets the command describe the folder path instead of just one folder name. [4][3]

  4. Copy the completed command lines—not the original names or formula cells—and paste them into Notepad. Save the file with a .bat extension, such as create-folders.bat; in the Save As dialog, choose All files as the file type and include .bat in the filename so Windows does not append .txt. [4]

Before saving, check that the pasted lines are plain commands rather than Excel formulas. For instance, the batch file should contain MD "Reports", not ="MD """&A2&"""". If you see formulas, copy the generated cell results and paste those into Notepad instead.

A user works between a folder-name spreadsheet and a Windows command window to create folders.

Run the batch file in the right location

  1. Choose the destination before you run the batch file. Create a parent folder for the new folders, or select an existing one, and confirm its full location in File Explorer. For example, if the batch file should create project folders inside D:\Work\Clients, make sure that is the parent folder you intend to use. Creating a parent folder first gives you a clear destination for the results. [1]

  2. Run the batch file from that parent folder. Place the batch file in the destination folder, then open it there so the generated folders appear alongside it. If you saved the batch file somewhere else, move or copy it into the chosen parent folder before running it. This keeps the output location clear and makes it easier to review what was created. [4]

  3. Test a few entries before processing the complete list. Make a small test batch with a handful of names, run it in the chosen parent folder, and open that folder in File Explorer. Check that the folders are present and that their names match the test entries; for example, verify that Invoices, Receipts, and Statements appear as separate folders. If the result looks right, run the batch file made from the full list. A small trial lets you catch a destination or naming mistake before creating the whole set. [4]

  4. Use an Excel add-in if you prefer a point-and-click method. An add-in such as ASAP Utilities can create folders from selected cells containing folder names or parent\subfolder paths, and lets you choose a destination folder. [5] This can suit you if you would rather select the cells and destination in a tool than run a batch file. The same location check still matters: choose the intended parent folder before creating the set.

Check these details if folders are missing

A missing folder often points to a mismatch between the batch file, its commands, or the location where you ran it. Check those details before running the file again, especially if the destination already contains important folders.

Confirm the batch file type

Check the file’s full name in File Explorer. It should end in .bat; a file named folders.bat.txt is still a text document, not a batch file. Windows may hide known file extensions, so look at the file’s Type column or turn on file-name extensions to confirm what you saved.

If it is a text document, save it again with a .bat extension and verify the resulting filename before opening it. The commands in a batch file can create folders when run in a command-line workflow, so the file type matters. [4]

Review the commands and destination

Open the batch file in Notepad and look for empty command lines, missing folder names, or rows that became blank during copying. A blank or malformed command will not give you the intended folder name; compare the commands with the corresponding Excel cells and correct any mismatches before trying again.

Check the parent folder used to run the commands. The Excel workflow relies on running the commands from the chosen parent location. [2]

For nested folders, inspect the path separators and the order of each part. Excel-based methods can create folders and subfolders from path values. [4][3]

Review before rerunning

Do not rerun the batch file in a location containing important folders until you have reviewed every command. A repeated run can make it harder to tell which folders came from the earlier attempt and which came from the new one. If the destination is unclear, inspect the commands and locate the intended parent folder before proceeding.

How the Excel-to-folder process works

The table shows each step for creating folders from an Excel list and what to check before moving on.

Step

What to do

What to check

Prepare the list

Put one folder name per row in a single Excel column.

Remove blank rows and duplicates; review names and choose whether to use nested paths.

Generate commands

Add a formula beside each name to create an MD command.

Inspect the results for missing names, errors, or unwanted text.

Save the batch file

Copy the generated command lines into Notepad and save them as a .bat file.

Confirm the file contains plain commands, not formulas, and ends in .bat.

Test and run

Run a small test batch from the intended parent folder, then run the full list if it works.

Check that the folders appear in the right location with the expected names.

Frequently Asked Questions

What Excel formula creates a folder command from a name?

Put a folder name in one cell and enter a formula beside it that joins the Windows MD command with that cell. If the name is in A2, use ="MD """&A2&"""". The extra quotes keep names with spaces, such as Tax Records, as one folder. Fill the formula down the column, then inspect the generated lines for missing names, errors, or unwanted text.

How do I save Excel folder commands as a batch file?

Copy the generated command lines, not the original names or formula cells, and paste them into Notepad. Save the file with a .bat extension, choose All files as the file type, and include .bat in the filename. Check that the saved file contains plain commands such as MD "Reports", not Excel formulas.

How can I create nested folders from an Excel list?

Put the parent folder and subfolder in the same cell, separated by a backslash, such as Projects\April. Generate a command from that cell; the resulting line should be MD "Projects\April". Copy the command into the batch file, then run it from the parent folder you chose.

Where should I run the batch file so the folders appear in the right place?

Choose or create the parent folder where you want the new folders to appear. Place the batch file in that destination folder and open it there; the generated folders should appear alongside it. If the batch file is elsewhere, move or copy it into the chosen parent folder before running it.

What should I check if the batch file does not create the folders?

Confirm that the file’s full name ends in .bat, rather than .bat.txt, and check that it contains commands instead of Excel formulas. Review the lines for blank commands, missing names, or copying errors, and confirm that you ran the file from the intended parent folder. Test corrected commands in a separate, empty location first.

Use a test run before creating the full set

The safest way to create folders from an Excel list is to prepare the names, inspect the generated commands, and run them from the parent folder you chose. Before processing the full spreadsheet, try a small test set and check the results in File Explorer.

For example, if your list contains project names, test with just two or three entries such as Project-A and Project-B. Run those commands in a new, clearly named test folder, then open it in File Explorer and confirm that the folder names and locations look right. This gives you a chance to catch a misplaced command or an unexpected name before you create the rest.

Once the test matches what you intended, use the same checked workflow for the remaining rows: prepare the list, generate and inspect the command lines, and run them from the intended parent folder. If you spot a problem during the test, fix the list or command lines first rather than processing the full set. That small check helps keep the final folder set organized where you expect it.

Sources

  1. Litigation Support Tool Tip – Create Folders from a List in …

  2. Tip of the Week: Batch Create Folders Using Microsoft Excel

  3. Create multiple folders and subfolders from a list of data in …

  4. Bulk Create Folders (and Subfolders) Using Excel List

  5. Create Folder Structure in a Destination Folder from Cell …