CMD MD Command Create folder _dos/bat

Source: Internet
Author: User
For example, MD D:\test can also use MD test to create a test folder under the current path.

If you want to create a folder with spaces or ampersand, you need to enclose the folder name in quotation marks, such as MD "Test ABC", MD "ABC&XYZ". What would be the consequences if you didn't use quotes?

The results of the test are:

1. If the folder name has a space, then the MD test ABC statement creates test and ABC folders in the current directory; With this feature, we can sometimes receive the magic of simplicity: if you want to create the three folders of ABC def XYZ, use the MD ABC def XYZ directly , and you don't need to ligatures three MD statements. Of course, the MD ABC;DEF;XYZ or MD ABC,DEF,XYZ is also possible.
2, if the folder name contains and, then, MD ABC&XYZ will create ABC this folder, and prompted that: ' XYZ ' is not an internal or external command, is not a running program or batch file, because,& is a composite statement of the connection symbol, It treats the two parts as two sub statements.

Advice: If the folder name contains special symbols, please do not forget to use double quotes!

MD also has a more convenient function: To create an intermediate directory. That is, a command such as MD a\b\c can create a folder A in the current directory, then create a folder under B,b under a folder C, coherent, without first MD A, then CD A, then MD B, CD B, then CD B, then MD C.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.