"Offering free computer help, hints, and tips to the Internet populace." Now with over 3,820 tips!

Windows XP and DOS

Create a Directory or Directory Tree

SUMMARY: Use the MKDIR command at a DOS prompt or batch file to create directories.

If you need a directory or group of directories made, you may wish to create them at the Windows XP DOS prompt rather than from Explorer. Or, you may need to create a directory via a batch file.

The mkdir or md command creates a directory or directory tree at the DOS prompt. You can include a drive letter and path in the command. Examples:

mkdir c:\Projects

Creates the Projects directory underneath the root of the C:\ drive.

mkdir "c:\Projects\Status Reports\2008 Status Reports\"

Creates the directory Projects underneath the root of the C:\ drive if it does not already exists. It also creates the Status Reports subdirectory underneath if it does not already exist. Then, it creates the 2008 Status Reports sub-subdirectory. Note that directories containing spaces should be surrounded by quotes.

This command will report an error if the directory or directory tree already exists, or if a file exists that matches the name of the directory/directory tree to be created.

* To remove a directory, use the RMDIR command.

Return to the Windows XP and DOS page.

Print this tip


Get the Newsletter

blog comments powered by Disqus

Thanks For Sharing!



Newest Tips:

Microsoft Word 2010
W0rds w8th Numbers Pass the S0ellchecker!
Google Gmail
Automatically Archive a Conversation you Respond to
Digital Photography
[MODIFIED] Did Someone Get in the Way While Taking a Photo?
Google Chrome
View Kittens and Pandas Everywhere!

Follow Us!

About MalekTips and the Author

The MalekTips website was created in 1998 by Andrew Malek of Envision Programming. The page's goal is to freely disperse computer-related tips, hints, and informative articles. Tips are organized to be easy to find, and are presented clearly, in easy-to-understand language. MalekTips also provides information and links to public-domain, open source, freeware, shareware, and commercial software available for download. < more >