Command referencemkdir
mkdir command (Windows / CMD)
What it does
Create a directory and any missing intermediate directories. Searches for the mkdir command cmd windows usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
Create a directory and any missing intermediate directories.
Syntax
mkdir [drive:]path [...]
Common options
| Flag / option | Meaning |
|---|---|
| path | Name the directory path to create. |
| md | Use the built-in short alias. |
| quoted path | Create a directory whose name contains spaces. |
Practical examples
Create folder
mkdir Reports
Creates Reports below the current folder.
Create nested path
mkdir Data\2026\September
Creates missing intermediate folders.
Path with spaces
mkdir "C:\Project Files\Demo"
Creates the quoted directory.
Linux ↔ Windows equivalent
Closest match: mkdir (Linux / bash / sh / zsh). Create one or more directories.
Common mistakes
- Leaving paths with spaces unquoted.
- Assuming forward slashes are safe path separators in every CMD context.
Related commands
- rmdirRemove an empty directory or an entire directory tree.
- cdDisplay or change the current directory in Command Prompt.
- mkdirCreate one or more directories.
- lsList directory entries and inspect file metadata.
- cdChange the shell's current working directory.
- dirList files and subdirectories with names, dates, sizes, and attributes.
- findWalk directory trees and select entries using tests and actions.
- Get-ChildItemEnumerate items and child items in filesystem, registry, and other providers.
FAQ
What does mkdir do in Command Prompt?
Create a directory and any missing intermediate directories.
How do I run mkdir in CMD?
Open Command Prompt and follow `mkdir [drive:]path [...]`; quote paths containing spaces.
What is a practical mkdir example in CMD?
Try `mkdir Reports` — Creates Reports below the current folder.
Can mkdir be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.