MS-DOS and Windows command line md and mkdir commands
The md and mkdir commands allow users to create directories.
Md and mkdir are internal commands that are available in the following Microsoft operating systems.
- All Versions of MS-DOS
- Windows 95
- Windows 98
- Windows ME
- Windows NT
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows 8
- Windows 10
- Windows 11
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:
is the same as:
mkdir \a chdir \a mkdir b chdir b mkdir c chdir c mkdir d
which is what you must type if extensions were disabled.
Md and mkdir examples
The example above 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.
Create the "test" directory in the c:\ directory.
Create the "test1" directory (if it does not already exist), and then the "test2" subdirectory, in the c:\ directory.