Command Prompt: Create Multiple Folders at Once

Create several folders in one Command Prompt session with `md` (also called `mkdir`). Follow examples for separate folders, nested paths, and a text-file list.

A Windows Command Prompt window lists folders in a user's directory and waits at the command line.
In this article

You can use Command Prompt to create multiple folders at once with md or mkdir. Both commands create directories, and a single command can create intermediate directories in a specified path. [1] This works on Windows 10 and Windows 11. [1]

Batch creation is useful when you’re setting up folders for a project, class, or work files. You can create sibling folders, build nested paths, or make folders from a prepared list; the right approach depends on how many names you have and how they’re organized. The examples ahead show each method so you can choose a practical fit for your folder setup.

Open Command Prompt in the folder you want to use

  1. Open File Explorer and browse to the folder where you want the new folders to go. Check the address bar to identify the destination—for example, C:\Users\Maya\Documents\Projects—and make sure it is the folder you intend to use.

  2. Open Command Prompt. Unless you specify a path, folders you create are placed relative to Command Prompt’s current location, which may not match the folder open in File Explorer. [1]

  3. In Command Prompt, look at the prompt before the > sign. Its drive and path show the current location; compare that path with the destination you chose in File Explorer. For example, if the prompt shows C:\Users\Maya\Documents>, the current location is Documents, not its Projects subfolder.

  4. If the paths match, continue with the folder-creation command in the next step of your process. If they do not, use Command Prompt’s documented navigation commands to change location, then check the prompt again before proceeding. The mkdir syntax accepts a path, so you can also specify a destination path when creating a directory. [1]

  5. Pause if the prompt shows a different drive or folder than expected. For example, a prompt beginning with D:\ points to a location on the D: drive, not the C: drive. Confirming the displayed location first helps you direct the operation to the intended destination instead of relying on the File Explorer window.

A Windows Command Prompt showing help text behind a Notepad window titled “How to open this file from Windows Terminal.”

Create several folders with one `md` command

Use one md command followed by several names to create a separate folder for each name. [2] For example, enter:

md Budget Photos Receipts

This creates Budget, Photos, and Receipts as separate folders in the current location. [2] In this example, each word after md is a folder name; choose short names that make the folders easy to recognize.

After you run the command, confirm the results in File Explorer by opening the destination folder and checking for Budget, Photos, and Receipts. You can also list the current directory in Command Prompt and check that those names appear in the output. [1]

For a school project, for instance, you might create Notes, Drafts, and Sources together. The command would be md Notes Drafts Sources; afterward, compare the names you entered with the folder names shown in File Explorer. [2] This gives you a quick visual check that the sibling folders you wanted are present.

If you do not see the folders, compare the command’s names with the names you expected, then check the destination again. Use the same location where you ran the command, and look for each folder individually rather than treating the group as a single folder. A clear set of names makes this check easier, especially when the folders are part of a larger project.

A Windows Command Prompt shows an `md` command creating three folders and the resulting directory listing.

Create nested folders in one command

Use md with a path to create a parent folder and its nested subfolders in one command. For example, to make a project folder with separate planning and drafts folders beneath it, enter:

md Project\Planning Project\Drafts

This creates Project as the parent folder, with Planning and Drafts inside it. Because the paths share the same first folder name, both subfolders sit under Project, rather than beside it. [1]

To place this structure somewhere other than Command Prompt’s current location, add the destination path in front of each nested path. For example, to create the same folders under C:\Work, enter:

md C:\Work\Project\Planning C:\Work\Project\Drafts

The resulting layout is C:\Work\Project\Planning and C:\Work\Project\Drafts; Project is the shared parent, while Planning and Drafts are its children. [1]

You can adapt the names to your own structure: replace Project with a parent-folder name such as Classes, then replace Planning and Drafts with subfolder names such as Notes and Assignments. Keep the same parent path at the start of each entry when the subfolders should belong to one parent. To build a different branch, change the path for that entry—for example, use C:\Work\Classes\Research\Sources to make Research and Sources nested beneath Classes. [1]

Each path describes only the folders along that path, so you can target the intended destination and branch without changing unrelated folders. [1]

Create folders from names in a text file

  1. Prepare a plain-text file with one folder name on each line. For example, write Invoices, Receipts, and Reports on separate lines so each entry is easy to check before you create the folders.

  2. Save the file as folders.txt in the folder where the new folders should go, open Command Prompt in that folder, and run this loop:

    for /f "usebackq delims=" %i in ("folders.txt") do md "%i"

    Each line becomes one folder; the quotes keep names with spaces together. In a batch file, write %%i instead of %i.

  3. Check the list before running the loop. Remove unintended blank lines, and make sure each entry is a valid folder name; for example, avoid names containing characters Windows does not allow in folder names. Keeping one name per line also makes it easier to spot spelling mistakes or duplicate entries.

  4. If you prefer a batch file, use the same prepared list as its input and follow Command Prompt’s documented batch-file syntax. The text-file workflow is useful when you have many names to process, such as a separate folder for each department or project; review the names first so the loop processes the entries you actually want.

Check the results and resolve common errors

If a folder is missing or appears in the wrong place, check the destination, spelling, and path before you try again. Small differences—such as a misspelled folder name or an unintended path—can make the result look different from what you expected.

First, open the destination in File Explorer and compare the folder names with the names you intended to create. Check each name and path for typos, extra characters, or a misplaced parent folder. For example, if you meant to create Reports\2025, make sure the resulting Reports folder is in the destination you had in mind.

If the folders appear elsewhere, verify Command Prompt’s current working location. A relative folder name is created in that location, so a different working location can put the folders in the wrong place. Check where Command Prompt is working before you run the command again.

If a folder was not created, check whether the requested path is valid and whether you have permission to write to that location. For example, a path with a spelling error may not point to the intended destination, and a protected location may reject a write. Correct the path or choose a location where you can create folders, then retry the operation.

Which method should you use?

Choose the method that matches the size of your list and whether folders need to sit inside other folders. A single md command is the simplest fit for a short set of sibling folders, while paths suit a parent-and-child structure; for a long list, use a text-file-based workflow. [1] [2] [3] To go further, see How to Create Multiple Folders at Once in Windows.

Method

Best for

What you specify

One md command

A short set of sibling folders

Several folder names [2]

Paths in a command

Parent-and-child folders

Each folder’s path [1]

Text-file workflow

A long list of folder names

Names prepared in a text file [3]

For example, choose one md command when you need a few independent folders, such as Reports, Photos, and Receipts, at the same level. This keeps a small batch together in one concise command. [2]

Use paths when the structure matters—for example, when Projects should contain 2025 and 2026. The paths specify where each directory belongs, so this method fits a parent folder with child folders. [1]

For a long list, a text-file-based workflow lets you keep the folder names together in a file and use Command Prompt to process them. The for /f loop above reads the file line by line; the text-file approach is more suitable when entering every name directly in one command would be cumbersome. [3] For more detail, see How to Create Folders From a Text List in Windows.

The main difference is how you provide the names: directly in one command, as paths, or in a text file. Choose based on whether your folders are siblings, nested, or numerous.

Verify the folder structure before adding files

Before adding files, open the destination and compare the folders you see with the structure you intended to create. Check both the main folders and any expected subfolders; a folder name alone does not confirm that its child folders are present.

For a larger batch, try your adapted example with a small set of names first, then review the result before applying it to the full list. Keep your original list of intended names as a checklist—for example, compare each planned project folder and subfolder against what appears in the destination. This gives you a clear next step if something is missing: identify the unmatched name and address that folder before adding files.

Sources

  1. mkdir

  2. How to Create Multiple Folders at the Same Time : 3 Steps

  3. Create a multiple folders using a text file. Windows Command …