Dos The DEL command is used to delete the file, and dos under the RD command is used to delete the folder, the specific use of the command to see the following text: Del command: Delete one or several files. DEL [/P] [/f] [/S] [/q] [/a[[:]attributes]] nameserase [/p] [/F] [/S] [/q] [/a[[:]attributes]] names names specifies a list of files or directories. Wildcard characters can be used to delete multiple files. If a directory is specified, all files in the directory will be deleted. /P Prompt for confirmation before deleting each file. /F Forces the deletion of read-only files. /s Deletes the specified file from all subdirectories. /q Quiet mode. When you delete a global wildcard, no acknowledgement is required. /A Select the files to delete based on the attributes. Attributes R read-only file S System file H hidden file A archive file-a prefix that indicates "no" if the command extension is enabled, DEL and ERASE will be changed as follows: The display syntax of the/S switch is reversed, that is, only files that have been deleted are displayed, not files that cannot be found.
Grammar
del [Drive:][path] FileName [...] [/P] [/F] [/s] [/Q] [/a[:attributes]]
erase [Drive:][path] FileName [...] [/P] [/F] [/s] [/Q] [/a[:attributes]]
Parameters
[Drive:] [Path] FileName
Specifies the location and name of the file or set of files to be deleted. FileName is a required item. You can use more than one file name. Separate file names with spaces, commas, or semicolons.
/P
Prompts you to confirm whether to delete the specified file.
/F
Force deletion of read-only files.
/s
Deletes the specified file from the current directory and all its subdirectories. Displays the name of the file that is being deleted.
/q
Specifies quiet mode. Do not prompt for deletion confirmation.
/A
Deletes a file based on the specified property.
Attributes
Can be any of the file attributes listed in the following table. Property Description
R Read-only
A archive
s system
H Hidden
-The prefix indicates "non"
/?
Displays help at the command prompt.
Notes
Use/P
If you use/p,del, the file name is displayed and the following message is sent:
FileName, do you want to delete it?
Press Y to confirm the deletion, press N to cancel the deletion and display the next file name (if a set of files is specified). Press CTRL + C to stop the DEL command.
Disabling command Extensions
If you disable command extensions, the/s command-line option displays any file names that are not found, rather than displaying the filename being deleted (that is, the behavior is reversed). For more information on disabling command extensions, see "Related Topics" in cmd.
Delete multiple files at once
By typing the del command, followed by [Drive:]path, you can delete all the files in the folder. For example, the following command deletes all files in the/work folder:
Del/work
You can also use wildcards (* and?) to delete multiple files at a time. However, you should use wildcards sparingly when using the DEL command to avoid accidentally deleting a file. For example, if you type the following command:
Del * *
The Del command displays the following prompt:
All files in this directory are deleted! Are you sure (y/n)?
To delete all the files in the current folder, press Y, and then press Enter. To cancel the deletion, press N, and then press Enter.
Before using wildcards with the del command to delete a set of files, use the dir command with the same wildcard character to view a list of all the files included in the group.
Key points
After you delete a file from a disk using Del, you cannot retrieve it.
You can use the DEL command (with various parameters) from the Recovery Console.
Example
To remove a drive c:/ Above all files in the Test folder, type one of the following commands:
Del c:/test
Del c:/test/*.*rd command: Deletes a directory. RMDIR [/s] [/q] [DRIVE:]PATHRD [/s] [/q] [drive:]path/s In addition to the directory itself, all subdirectories and files under the specified directory will also be deleted. Used to delete a directory tree. /q Quiet mode, with/S does not require confirmation when deleting a directory tree
DEL Rd Command