How to delete files and folders under DOS

Source: Internet
Author: User

To delete a folder or file in DOS, first determine if the folder or file has special properties, such as "system", "Read Only", "hide", and if so, remove these attributes, the command is as follows:

Folder: attrib c:windows-s-r-h

File: Attrib-s-h-r C:windowsautorun.inf

The delete command is as follows

Two scenarios:

First, with the RD internal command

If you want to delete the folder does not have subfolders, you can first use the "CD directory" to delete the directory, and then use Del *.* to remove all the files in the folder, and then "CD ..." Go back to the previous directory and delete the folder with the RD folder name. (Note: delete folders with rd command must be deleted in all files in the folder, and so the folder does not have subfolders, if a subfolder is deleted before operation)

Second, with deltree external command

Preferred to go back to the system root like C: Find the location of this command "dir deltree/s", and then use the CD to enter the directory corresponding to this command.

Then use the deltree [letter:] [path] folder name

To delete the Love folder in the C:windows directory, the corresponding command is "deltree c:windowslove" (Note: deltree deletes all files and folders under the folder.) It is an external command. If XP does not have its own, you need to find a bootable CD that contains this command. If the partition format is NTFS format, you also need to find the appropriate CD Boot ntfs-for DOS)

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.