You can create dozens or hundreds of folders at once in Windows 10 and Windows 11 by listing one folder name per line in a plain text file and reading that file into PowerShell with Get-Content and New-Item -ItemType Directory. This procedure works identically in the built-in Windows PowerShell 5.1 environment shipped with every supported edition of Windows 10 and Windows 11, as well as cross-platform PowerShell 7.x. Combining Join-Path and Test-Path ensures that PowerShell builds clean directory paths inside your chosen parent folder, ignores blank lines in your list, and skips any folder that already exists without modifying or deleting existing files.

A Windows 11 desktop shows PowerShell creating project folders alongside File Explorer displaying them. Prerequisites and Windows Naming Rules​

Before creating your folder list and running PowerShell commands, verify that your target location and proposed folder names meet Windows file system requirements:

  • Permissions: A standard user account can create folders inside user profile locations (C:\Users\<Username>\Documents, Desktop, or custom folders on secondary drives where your account has Modify or Write permissions). Creating folders inside system-protected locations such as C:\Program Files, C:\Windows, or the root of the system drive (C:\) requires an elevated PowerShell session (Run as administrator).
  • Plain-text list format: Your source file must be an unformatted plain text file (.txt) saved in UTF-8 encoding. Do not use Word documents (.docx) or Rich Text Format (.rtf) files, as Get-Content will read document formatting metadata as literal characters.
  • Disallowed characters: Microsoft's Win32 file naming specification prohibits nine reserved characters in folder names: < (less than), > (greater than), : (colon), " (double quote), / (forward slash), \ (backslash), | (vertical bar or pipe), ? (question mark), and * (asterisk). Note that if a line in your text file contains a backslash (\) or forward slash (/), PowerShell treats that line as a nested relative path (such as 2026\Invoices) rather than a single folder name.
  • Reserved device names: Windows forbids folders named CON, PRN, AUX, NUL, COM1 through COM9, and LPT1 through LPT9 (as well as superscript digit variants).
  • Trailing characters and path length: Do not end a folder name with a space or a period (.), as the Windows shell strips or misinterprets them. Keep the combined full path (parent directory path plus the new folder name) under the 260-character Win32 maximum path limit unless long paths are explicitly enabled on the system.

Prepare the Text File and Parent Folder​

Start by creating the parent folder that will hold your new directories and the plain text file containing the list of folder names.

  1. Open File Explorer (Win + E) and navigate to or create the parent folder where you want the batch of new folders to live. For this guide, the examples use C:\Projects\ClientFolders as the parent folder.
  2. Open Notepad by pressing Win + R, typing notepad, and pressing Enter.
  3. Type or paste your desired folder names into Notepad so that each folder name is on its own separate line. Spaces, hyphens, underscores, and parentheses are allowed:
    Code:
    01 - Project Charter
    02 - Contracts and Legal
    03 - Design Assets
    04 - Financial Reports
    05 - Deliverables
    Archive [Final]
  4. In Notepad, click File > Save as.
  5. Navigate to a convenient location—either inside C:\Projects or right inside C:\Projects\ClientFolders—and set Save as type to *Text Documents (.txt)**.
  6. Set Encoding (located near the Save button in both Windows 10 and Windows 11 Notepad) to UTF-8.
  7. Name the file FolderList.txt and click Save. In our example, the full path to the text file is C:\Projects\FolderList.txt.

Create the Folders with Windows PowerShell​

The safest way to create folders from a text list is to iterate through each non-empty line, combine the parent path and folder name using Join-Path, check whether the target path already exists with Test-Path, and create only missing folders.

Step 1: Open Windows PowerShell​

Choose the launch method for your Windows version:

  • Windows 11: Right-click the Start button and select Terminal (or Terminal (Admin) if writing to a protected system path). Ensure the active tab dropdown in the title bar is set to Windows PowerShell or PowerShell.
  • Windows 10: Right-click the Start button and select Windows PowerShell (or Windows PowerShell (Admin) if writing to a protected system path).

Step 2: Preview the Operation Using -WhatIf​

Before creating decenas or hundreds of directories on disk, run a dry-run preview using PowerShell's -WhatIf switch. This validates your file path and shows the exact folder paths PowerShell will generate without modifying the drive.

  1. Copy the following block, adjust $ListFile and $ParentFolder if you saved your file or folder in a different location, paste it into the PowerShell window, and press Enter:
    Code:
    $ListFile = "C:\Projects\FolderList.txt"
    $ParentFolder = "C:\Projects\ClientFolders"
    
    Get-Content -LiteralPath $ListFile | ForEach-Object {
        $FolderName = $_.Trim()
        if (-not [string]::IsNullOrWhiteSpace($FolderName)) {
            $TargetPath = Join-Path -Path $ParentFolder -ChildPath $FolderName
            if (-not (Test-Path -LiteralPath $TargetPath)) {
                New-Item -Path $TargetPath -ItemType Directory -WhatIf
            } else {
                Write-Host "Skipping existing path: $TargetPath" -ForegroundColor Yellow
            }
        }
    }
  2. Review the output in the console. For every new folder, PowerShell prints a message reading:
    What if: Performing the operation "Create Directory" on target "Destination: C:\Projects\ClientFolders\01 - Project Charter".
  3. Verify that the destination paths point inside your intended parent folder and that no stray text or garbled characters appear.

Step 3: Execute the Folder Creation​

Once the preview confirms the target paths are accurate, run the command without -WhatIf to create the folders.

Warning: Always make sure -ItemType Directory is explicitly included in your New-Item command. While New-Item with -ItemType Directory will never erase an existing folder's contents—even if you add the -Force switch—running New-Item -ItemType File -Force against an existing file overwrites that file with an empty zero-byte file. Using Test-Path -LiteralPath as shown below prevents collisions with both existing folders and existing files of the same name.
  1. Run the live creation block in your PowerShell session:
    Code:
    $ListFile = "C:\Projects\FolderList.txt"
    $ParentFolder = "C:\Projects\ClientFolders"
    
    Get-Content -LiteralPath $ListFile | ForEach-Object {
        $FolderName = $_.Trim()
        if (-not [string]::IsNullOrWhiteSpace($FolderName)) {
            $TargetPath = Join-Path -Path $ParentFolder -ChildPath $FolderName
            if (-not (Test-Path -LiteralPath $TargetPath)) {
                New-Item -Path $TargetPath -ItemType Directory | Out-Null
                Write-Host "Created: $TargetPath" -ForegroundColor Green
            } else {
                Write-Warning "Already exists (skipped): $TargetPath"
            }
        }
    }
  2. Wait for the command to finish. For a list of a few dozen or a few hundred folders, execution completes in less than a second. Each newly created folder prints in green (Created: ...), and any folder that already existed prints a yellow warning (WARNING: Already exists (skipped): ...).

How This Command Protects Existing Folders​

  • $_.Trim() and IsNullOrWhiteSpace: Strips accidental leading or trailing spaces from each line in FolderList.txt and ignores blank lines at the middle or bottom of the file. Without this check, an empty line in the text file causes Join-Path to point at $ParentFolder itself.
  • Join-Path: Combines $ParentFolder and $FolderName with a single backslash regardless of whether you typed a trailing backslash in $ParentFolder.
  • Test-Path -LiteralPath: Checks whether an item with that exact name already exists before calling New-Item. Using -LiteralPath instead of -Path ensures that folder names containing square brackets (such as Archive [Final]) are treated as literal characters rather than PowerShell wildcard patterns.
  • | Out-Null: Suppresses PowerShell's default table output for each directory object so you get a clean, readable line-by-line status report.

Verify the Results​

After running the script, you can confirm straight from PowerShell that every folder listed in your text file now exists inside the parent directory.

  1. To list all folders currently inside the parent directory, run:
    Get-ChildItem -LiteralPath $ParentFolder -Directory | Select-Object Name, CreationTime
  2. To run an automated audit that compares every line in FolderList.txt against the parent directory and reports whether each folder is Present or Missing, run:
    Code:
    Get-Content -LiteralPath $ListFile | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | ForEach-Object {
        $Name = $_.Trim()
        $CheckPath = Join-Path -Path $ParentFolder -ChildPath $Name
        [PSCustomObject]@{
            FolderName = $Name
            Exists     = (Test-Path -LiteralPath $CheckPath -PathType Container)
            FullPath   = $CheckPath
        }
    } | Format-Table -AutoSize
  3. Check the Exists column in the resulting table. Every folder from your list should display True. If an entry shows False, either the name contained an invalid character that prevented creation, or a file (rather than a folder) already occupied that exact name.

Alternate Method: One-Line Command for Nested Folder Trees​

If your text file contains multi-level relative paths (such as 2026\Q1\Invoices, 2026\Q1\Receipts, 2026\Q2\Invoices) or if you just want a compact one-liner for a clean list, you can use New-Item -ItemType Directory -Force.

According to Microsoft Learn's documentation for New-Item, when -ItemType Directory is paired with the -Force switch, PowerShell behaves safely in two ways:

  1. It automatically creates any missing intermediate parent folders in a nested path.
  2. If a folder already exists, New-Item -ItemType Directory -Force does not overwrite, empty, or replace the existing folder; it leaves all existing files inside the folder intact and simply returns the existing directory object.

Run this one-liner to create either flat or nested directory structures from your text file:

Get-Content -LiteralPath "C:\Projects\FolderList.txt" | Where-Object { $_.Trim() } | ForEach-Object { New-Item -Path (Join-Path "C:\Projects\ClientFolders" $_.Trim()) -ItemType Directory -Force }

Use the primary Test-Path procedure from the previous section when you want explicit console warnings showing which folders already existed versus which folders were newly created. Use this -Force one-liner when you simply want to ensure all folders and subfolders in a list exist on disk regardless of prior state.

Troubleshooting Common Failures and Rollback​

Symptom-to-Fix Mapping​

  • Error: New-Item : An item with the specified name ... already exists.
    • Cause: You ran New-Item -ItemType Directory without checking Test-Path first and without the -Force parameter, and one of the folders in your list was already on disk.
    • Fix: Use the if (-not (Test-Path -LiteralPath $TargetPath)) wrapper from the primary procedure, or append -Force to New-Item -ItemType Directory. Neither approach deletes existing files inside the directory.
  • Error: New-Item : The filename, directory name, or volume label syntax is incorrect. or Illegal characters in path.
    • Cause: A line in your text file contains one of the reserved Windows characters (< > : " | ? *). In Windows PowerShell 5.1, passing a colon (:) inside a folder name can also trigger NotSupportedException (The given path's format is not supported).
    • Fix: Open your text file and remove the disallowed punctuation, or strip illegal characters automatically inside the loop before Join-Path by sanitizing $FolderName:
      Code:
      $InvalidChars = [IO.Path]::GetInvalidFileNameChars() -join ''
      $CleanName = $FolderName -replace "[$([Regex]::Escape($InvalidChars))]", "_"
  • Folders with [ or ] in their names fail to create or report strange path errors
    • Cause: In PowerShell, -Path treats square brackets ([ ]) as wildcard character ranges. When New-Item -Path or Test-Path -Path encounters a name like Project [2026], it attempts to resolve [2026] as a wildcard.
    • Fix: For Test-Path and Get-Content, always use -LiteralPath instead of -Path. If your folder list contains square brackets and New-Item -Path fails on them, pass the parent folder to -LiteralPath (or -Path if the parent has no brackets) and the new folder name to the -Name parameter:
      New-Item -LiteralPath $ParentFolder -Name $FolderName -ItemType Directory
  • Accented characters, umlauts, or non-Latin characters appear scrambled in folder names
    • Cause: Windows PowerShell 5.1 defaults to the system's legacy Windows-1252/ANSI code page when reading files that lack a Byte Order Mark (BOM), whereas modern Notepad saves files as UTF-8 without BOM.
    • Fix: Add -Encoding UTF8 to the Get-Content command:
      Get-Content -LiteralPath $ListFile -Encoding UTF8
  • PowerShell creates nested subfolders instead of a single folder name
    • Cause: A folder name in your text file contains a forward slash (/) or backslash (\), such as Accounts Receivable / Payable. Windows interprets both slashes as directory separators.
    • Fix: Replace / or \ in your text file with a hyphen (-) or underscore (_), such as Accounts Receivable - Payable.

Rolling Back Accidental Folder Creation​

If you specified the wrong $ParentFolder (for example, dumping 100 folders onto your Desktop or into C:\Projects instead of C:\Projects\ClientFolders) and need to remove the folders created from the text file, you can use the same text file to clean them up.

Warning: The rollback command below deletes only empty folders that match the names in your text file. It purposefully omits the -Recurse parameter so that if your list happened to contain the name of an existing folder that already held files or subfolders, PowerShell will refuse to delete it cleanly rather than wiping out your data.
  1. Run the following script to remove only empty folders matching FolderList.txt from the target parent folder:
    Code:
    $ListFile = "C:\Projects\FolderList.txt"
    $WrongParentFolder = "C:\Projects"
    
    Get-Content -LiteralPath $ListFile | ForEach-Object {
        $FolderName = $_.Trim()
        if (-not [string]::IsNullOrWhiteSpace($FolderName)) {
            $TargetPath = Join-Path -Path $WrongParentFolder -ChildPath $FolderName
            if (Test-Path -LiteralPath $TargetPath -PathType Container) {
                $ItemCount = (Get-ChildItem -LiteralPath $TargetPath -Force | Measure-Object).Count
                if ($ItemCount -eq 0) {
                    Remove-Item -LiteralPath $TargetPath -Force
                    Write-Host "Removed empty folder: $TargetPath" -ForegroundColor Cyan
                } else {
                    Write-Warning "Skipped non-empty folder ($ItemCount items inside): $TargetPath"
                }
            }
        }
    }
  2. Verify in File Explorer or with Get-ChildItem -LiteralPath $WrongParentFolder that the stray empty folders have been removed while all populated directories remain untouched.