You can create folders from a text list in Windows by using a short PowerShell script that turns each line into a folder name. Prepare the names, choose where the folders should go, run the script, and then check the results. You may also find this useful: How to Create Folders from an Excel List in Windows.
This approach is useful when you already have a list of names and want to make matching folders without creating them one at a time. For example, a list with “Invoices,” “Receipts,” and “Reports” represents three folders. The steps are intended for Windows 10 and Windows 11.
The process is straightforward: make the list, choose a destination, run the script, and review the folders. The sections below walk through those steps in order, so you can follow along with your own names and destination.
What to prepare before you start
Prepare a clean text list and a safe destination before you create folders from it. The workflow uses PowerShell, so choose the output folder deliberately and review its path before running the commands.
Prepare the text file
Put one intended folder name on each line in a plain-text file. For example, you might list Invoices, Receipts, and Projects on separate lines. Keep each line to the name you want for a folder rather than adding notes or instructions.
Review the list for blank lines and repeated names. Also remove characters that Windows does not allow in folder names; if you are unsure about an entry, simplify it to ordinary words, spaces, or hyphens. A quick pass through the file can help you catch an accidental empty line or a name copied twice.
Choose a destination
Save a separate copy of your list, then choose the folder where the new folders should go. If you are uncertain how the process will affect your files, use a test location first—for example, a temporary folder you can inspect before choosing a permanent destination.
Because the next step uses PowerShell to make changes, check the destination carefully before you run it. A simple way to avoid confusion is to open the intended output folder in File Explorer and confirm that it is the location you meant to use.
Create the folders with PowerShell
Open PowerShell from the Start menu. In the script below, replace
C:\Lists\folders.txtwith the full path to your text file, and replaceC:\Projectswith the folder where you want the new folders created.
$listPath = 'C:\Lists\folders.txt'
$destination = 'C:\Projects'
Get-Content -LiteralPath $listPath | ForEach-Object {
$name = $_.Trim()
if ($name -ne '') {
New-Item -ItemType Directory -Path (Join-Path $destination $name)
}
}
Check both paths before running the script: the first should point to your list, and the second to the intended destination. The script trims spaces from the start and end of each line, skips lines that are empty after trimming, and creates a folder for each remaining name.
For example, if your list contains
Invoices,School, andTravel, the script createsC:\Projects\Invoices,C:\Projects\School, andC:\Projects\Travel. Update the paths to match your computer, then paste the script into PowerShell and press Enter. Verify the destination and folder names before you run it, since the command makes changes there.
Check the folders and fix common issues
Open the destination in File Explorer and compare the folders with your text list to catch missing names, misspellings, or unexpected results. For example, if your list includes “Invoices,” “Receipts,” and “Tax Records,” check that each appears in the destination and is spelled as intended.
Check for duplicates and missing folders
A duplicate name does not create a second, distinct folder with the same name in the same destination. Before running the process, look for folders that are already there; an existing folder may make it seem as though a new one was created when it was already present.
If a name is missing, check the text file path and destination path first. Then review the list for blank lines, extra spaces, or spelling differences; for example, “Project Photos” and “Project Photo” are different names.
Review unusual entries
Keep folder names simple if an entry contains a nested path or unusual characters. A line such as Work\2025 may not produce the folder structure you intended, so use straightforward names like Work 2025 unless you have deliberately set up the process to handle nested paths.
If you see a problem, fix the affected line or path and run the process again only after checking the destination. That helps you avoid creating folders in the wrong location or overlooking an existing folder.
Create folders from a text list in Windows
The table shows the main steps for creating and checking folders from a text list.
Step | What to do | What it means |
|---|---|---|
Prepare the list | Put one folder name on each line; remove blank lines and repeated names. | Each line is used as a folder name. |
Choose a destination | Select and check the folder where the new folders should go. | The destination is where PowerShell creates them. |
Run PowerShell | Set the list and destination paths, then run the script. | The script trims line edges, skips empty lines, and creates folders for the remaining names. |
Review the result | Compare the folders in File Explorer with your list. | You can catch missing names, spelling differences, or unexpected results. |
Frequently Asked Questions
How should I format a text file to create folders from a list in Windows?
Put one intended folder name on each line in a plain-text file. Remove blank lines, repeated names, notes, and characters Windows does not allow in folder names. The PowerShell script trims spaces at the start and end of each line and skips lines that are empty after trimming.
How do I choose where the folders will be created?
Choose the destination folder before running PowerShell, and check its path carefully. You can open the intended folder in File Explorer to confirm it is the right location. If you are unsure how the process will affect your files, try a temporary test location first and inspect the results.
What should I change in the PowerShell script before running it?
Replace C:\Lists\folders.txt with the full path to your text file, and replace C:\Projects with the destination folder for the new folders. Check that the first path points to your list and the second to the intended destination, then paste the script into PowerShell and press Enter.
Why might a folder from my list be missing after I run the script?
Check the text file path and destination path first. Then review the list for blank lines, extra spaces, or spelling differences. The script skips lines that are empty after trimming, and names such as “Project Photos” and “Project Photo” are treated as different names.
Can I use a text list to create nested folders with this script?
Keep entries simple if you want ordinary folders. A line such as Work\2025 may not produce the folder structure you intended, so use a straightforward name such as Work 2025 unless you have deliberately set up the process to handle nested paths. Check the destination before running it.
Use your text list as a folder plan
Keep the process simple: use a clean list, check where the folders will go, run the PowerShell steps, and inspect what was created. That final check helps you catch a typo or a folder made in the wrong place before you rely on the new set.
If you have a long list, try the workflow first with a few sample names in a separate test location. For example, use Invoices, Receipts, and Travel as a small trial; confirm that the folders appear where expected, then use the larger list. This gives you a chance to get comfortable with the steps and spot a path mistake without processing all your names at once.
