Skip to main content

Command referencemkdir

mkdir command (Windows / CMD)

WindowsCMDfilebeginner

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 / optionMeaning
pathName the directory path to create.
mdUse the built-in short alias.
quoted pathCreate 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.

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.