Del (erase) deletes a specified file

Source: Internet
Author: User

Del (erase)
Deletes a specified file.

Syntax
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 to be deleted. Filename is required. Multiple File names can be used. Separate file names with spaces, commas (,), or semicolons.
/P
You are prompted to confirm whether to delete the specified file.
/F
Force Delete read-only files
/S
Delete a specified file from the current directory and all its subdirectories. Displays the name of the file being deleted.
/Q
Specifies the mute status. You are not prompted to confirm deletion.
/
Deletes an object based on the specified property.
Attributes
Specify any of the following file attributes: attribute description
R read-only
A Archive
S System
H hide
-The prefix indicates "not"

/?
Display help at the command prompt.
Note
Use/P
If/P is used, del displays the file name and sends the following message:

Filename, delete (y/n )?

Press Y to confirm deletion, N to cancel deletion and display the next file name (if a group of files is specified), or press Ctrl + C to stop the del command.

Disable command Extension
If the command extension is disabled, the/s command line option shows that no file name is found, rather than the name of the file being deleted (that is, the opposite behavior ). For more information about disabling command extensions, see CMD in.

Delete multiple files at a time
You can run the del command and [drive:] path to delete all files in the folder. For example, the following command can delete all files in the \ work folder:

Del \ work

You can also use wildcards (* And ?) Delete multiple files at a time. However, you must use wildcards carefully when using the del command to avoid accidental deletion of files. For example, if you type the following command:

Del *.*

The Del command displays the following prompt:

All files in directory will be deleted! Are you sure (y/n )?

Press Y and then press enter to delete all files in the current folder, or press N and then press enter to cancel the deletion.

Before you use the del command with a wildcard to delete a group of files, you can use the Dir command with the same wildcard to view the list of all file names contained in the group.

Warning

After a file is deleted from the disk using del, the file cannot be recovered.
You can use the del command (with various parameters) from the fault recovery console ).
Example
To delete all files in the test folder on drive c: \, type one of the following commands:

Del c: \ test

Del c: \ test \*.*

Xox

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.