Home > Commands A-M > Commands M

MKDIR (MD)


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Creates a directory.

You can use the MKDIR or MD command to create a multilevel directory (folder) structure.


Syntax

MD /?

MD [drive:]path

or

MKDIR [drive:]path


Parameters
drive: (v2.0 Win95 NT3.5)
Specifies the drive on which you want to create the new directory.
path (v2.0 Win95 NT3.5)
Specifies the name and location of the new directory. The maximum length of any single path from the root directory to the new directory is 63 characters (short filenames, 8Dot3) or 255 characters (long filenames), including backslashes (\).
Folder names are not case sensitive, but only folder names longer than 8 characters will always retain their case, as typed.

Switches
/? (NTXP)
Displays help.

Related

For information about deleting a directory, see the RMDIR command.
For information about changing directories, see the CHDIR command.
Equivalent Linux BASH commands:
mkdir - Create new folder(s).


Notes

Long filenames are not supported by ISO9660 (Macintosh) CDROM's.

You cannot create a folder with the same name as any of the devices: CON, PRN, LPT1..LPT9, COM1..COM9. This limitation ensures that redirection to these devices will always work.

If you plan to copy data onto CDROM avoid folder trees more than 8 folders deep.

If Command Extensions are enabled: create any intermediate directories, as needed:

    MKDIR \one\two\three\four

The same as (command extensions disabled):

    MKDIR \one
    MKDIR \one\two
    MKDIR \one\two\three
    MKDIR \one\two\three\four

Examples

Suppose you want to create a directory on the disk in the current drive and use the directory to store all your tax information. To create a directory named TAXES, type:

    MKDIR \TAXES

You could also type this command with the same results:

    MD \TAXES

Now suppose that the TAXES directory is the current directory and that you want to create a subdirectory of TAXES named PROPERTY. To create the PROPERTY directory, type:

    MKDIR PROPERTY

Errorlevels

none.


Availability
Internal
DOS
v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003