DEL and RD commands Delete special files and folders

Source: Internet
Author: User

DEL and RD commands Delete special files and folders

In Windows, sometimes some special folders or files cannot be deleted, especially files with system reserved characters, such as (con. bat ). You can do this as follows:

Right-click the desktop-New-Text Document-Write the following command:
DEL/F/A/Q \\? \ % 1
RD/S/Q \\? \ % 1
Save as "delete all. bat" (the name can be anything, but the suffix must be ". bat ")
Then, drag and drop the file or directory to be deleted to the icon of the bat file! (After deletion, you can put the new text document to the recycle bin)

DEL command parameter description:

/P prompts confirmation before deleting each file.
/F force Delete read-only files.
/S deletes the specified file from all subdirectories.
/Q quiet mode. Confirmation is not required when deleting a global wildcard.
/A select the file to be deleted based on the attribute.

RD command parameter description:

/S when deleting the directory tree, you do not need to confirm that non-empty directories can be deleted.

/Q quiet mode. Confirmation is not required when deleting a global wildcard.

\\? \ % 1 is a unc path.

A special case of a UNC path. The UNC path conforms to the \ servername \ sharename format. servername indicates the server name and sharename indicates the name of the shared resource .? It is a unified character, indicating that it matches 0 or 1 arbitrary character. You can use this method to delete special files or directories.

Therefore, you can use the preceding command to delete folders or files with special reserved characters.


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.