Microsoft DOS md and mkdir command

Updated: 05/21/2018 by Computer Hope

About md and mkdir

Allows you to create directories in MS-DOS.

Availability

The md and mkdir commands are internal commands that are available in the below Microsoft operating systems.

Md and mkdir syntax

Creates a directory.

MKDIR [drive:]path
MD [drive:]path

If Command Extensions are enabled, MKDIR changes as follows:

MKDIR creates any intermediate directories in the path, if needed.
For example, assume \a does not exist then:

mkdir \a\b\c\d

is the same as:

mkdir \a
chdir \a
mkdir b
chdir b
mkdir c
chdir c
mkdir d

which is what you would have to type if extensions were disabled.

Md and mkdir examples

md test

The above example creates the "test" directory in the current directory.

mkdir "computer hope"

The above command would create a directory called "computer hope". If you want a space in your directory name, it must be surrounded in quotes.

md c:\test

Create the "test" directory in the c:\ directory.

md c:\test1\test2

Create the "test1" directory (if it does not already exist), and then the "test2" sub-directory, in the c:\ directory.

Additional information

  • See our directory definition for further information and related links on this term.