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.