File cannot be deleted (directory is not empty) what to do?

Source: Internet
Author: User


1. There was a situation where files could not be deleted when the files were purged today
Use the following simple methods:

The code is as follows Copy Code

del/f/a/q\\?\%1
RD/S/q\\?\%1

Save the above code in a new text file, change the file name called Del.bat and drag the files you want to delete into the Del.bat (which is actually the command line deletion)

Special folders cannot be deleted

The so-called special folder refers to the folder that is established through a special method. Of course, it is not possible to use common methods to delete such folders. This type of folder behaves as:

① Establishment method

Command format: MD Letter: Folder name ...

Example: MD c:myfile.

In this way, in the C-packing directory, a special folder is established, the name of the folder is myfile. Notice that the name of the folder has one ". "(There is a point).

Once the folder is established, it cannot be opened and deleted using the normal method.

② Open method

Command format: Start Letter: Folder name ...

Example: Start c:myfile.

③ Delete method

Command format: RD drive: Folder name ...

Example: RD c:myfile..

If you cannot delete a folder with a point "." After its name, the description is a special folder and you want to delete it, please use the above method.

2. Alas, still cannot delete, System prompts me to CHKDSK and then executes on the command line after CMD

The code is as follows Copy Code

Chkdsk D:/F

After Y confirm the execution, the repair hard disk can be removed after the removal of the file can be deleted, above just

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.