Purpose:Create a subdirectory

 

Format:MD [/= /C /D /N[et] /S] path...

or

MKDIR [/= /C /D /N[et] /S] path...

 

path        The name of one or more directories to create.

 

/C(ompressed) /N(o update)
/D (change directory)/S(ubdirectories)

 

See also: RD.

 

Internet:  Can be used with FTP Servers.

 

File Completion Syntax:

 

The default filename completion syntax is: dirs

 

Usage:

 

MD and MKDIR are synonyms. You can use either one. If you don't specify any arguments, MD will display its command dialog.

 

MD creates a subdirectory anywhere in the directory tree. To create a subdirectory from the root, start the path with a backslash [\]. For example, this command creates a subdirectory called MYDIR in the root directory:

 

md \mydir

 

If no path is given, the new subdirectory is created in the current directory. This example creates a subdirectory called DIRTWO in the current directory:

 

md dirtwo

 

To create a directory from the parent of the current directory (that is, to create a sibling of the current directory), start the pathname with two periods and a backslash [..\].

 

Windows limits the maximum length of the subdirectory name. See Directories and Subdirectories for details.

 

When creating a directory on an LFN drive, you must quote any path which contains white space or special characters.

 

If MD creates one or more directories, they will be added automatically to the extended directory search database unless the /N option is specified.

 

You can create directories on FTP servers. For example:

 

md ftp://ftp.abc.com/data/index

 

MD sets two internal variables:

 

%_md_dirsThe number of directories created
%_md_errorsThe number of errors

 

Options:

 

/=Display the MD command dialog to help you set the directory and command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/CCreate a compressed subdirectory.

 

/DChange to the newly created subdirectory.

 

/NIf /N has no additional options, do not update the CD / CDD extended directory search database, JPSTREE.IDX. This is useful when creating a temporary directory which you do not want to appear in the extended search database. /N takes two optional arguments:

 

eDon't display non-fatal errors. (Note that a /Ne alone will still update the extended directory search database.)
tDon't update the extended directory search database. (This is the same as /N with no options.)

 

/SAllows you to create more than one directory at a time. For example, if you need to create the directory C:\ONE\TWO\THREE and none of the named directories exist, you can use /S to have MD create all of the necessary subdirectories in a single command (without the /S, this command will fail because the parent directory C:\ONE\TWO does not exist):

 

md /s \one\two\three

 

For compatibility with CMD, /S becomes the default if you enable TCC extensions with the /X switch on the TCCstartup command line. See Command Line Options for details on /X.