How to create a folder
Overview
mkdir, abbreviated md, creates directories. It can create missing intermediate folders in a path.
Choose a location you own, such as Documents, and use descriptive names. Existing folders are left in place, though CMD reports that they already exist.
- Quotes make a spaced name one argument.
- Several simple names on one line create several sibling folders.
- Nested creation is useful when preparing a project structure.
Commands to try
Type each command at the prompt, then press Enter. Replace sample names and paths with ones that exist on your computer.
Commands are generally not case-sensitive, but preserving the spelling shown here makes scripts easier to read.
cd /d "%USERPROFILE%\Documents"
mkdir CmdPractice
mkdir "Cmd Practice\Notes"
mkdir One Two Three
dir /a:d
Useful options and details
Options change how a command behaves. Add spaces exactly as shown, and use the command's built-in help when an option is unfamiliar.
A path containing spaces must be enclosed in double quotes, such as "C:\My Files".
mdandmkdirare aliases in CMD.- There is no required option for ordinary folder creation.
- Use
dir /a:dto show only directories afterward.
Tips and common mistakes
Check the current folder and read the command output before assuming an operation succeeded.
Practice with disposable files first. Commands that delete, overwrite, or stop a process may not offer an Undo button.
- Without quotes,
mkdir Cmd Practicecreates two folders. - Access denied usually means the parent folder is protected or belongs to another account.
- Do not create test folders in a drive root or Windows system directory.
Safe practice
Create a temporary practice folder under your user profile so the examples cannot affect Windows system files.
After each command, inspect the result with dir or another read-only command before continuing.
- Create
CmdPracticeunder Documents. - Create nested
Notes\Draftsinside it. - List the result and keep it for later lessons.