Programming Field

Md, Mkdir - DOS/Command Prompt Reference

Creates a new directory.

Syntax

md <directory>
mkdir <directory>

Options

md, mkdir This command can be either ‘md’ or ‘mkdir’.
<directory>

Specifies a new directory to create. If specifying ‘path1\path2’, this command will create path2 directory in the path1, but in this case path1 must exist.

[Windows NT series] [Extensions] If Extensions are enabled, if specifying ‘path1\path2’ and path1 does not exist, the command also creates path1 directory.

Samples

Usage of Md(Mkdir)

Sample 1

mkdir Temp

Creates a directory ‘Temp’ in the current directory.

Sample 2

md C:\Programs\MyProg

Creates a directory ‘MyProg’ in ‘C:\Programs’. If ‘C:\Programs’ does not exist, this command fails.

[Windows NT series] [Extensions] With Extensions enabled, the directory will be created if C drive exists, even if C:\Programs does not exist. (C:\Programs will also be created.)