Table of Contents
Del Command in Windows is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
The del command deletes one or more files. This command is the same as the eraser command .
For an example of how to use this command, please see the Example below.
Syntax del command
del [/p] [/f] [/s] [/q] [/a[:]] erase [/p] [/f] [/s] [/q] [/a[:]]
Parameters
ParametersDescription Specifies a list of one or more files or directories. Wildcards can help delete multiple files. If a folder is specified, all files in the folder will be deleted. / p Confirmation prompt before deleting the specified file. / f Force deleting read-only files (read only). / s Delete specific files from the current directory and all subdirectories. Displays the names of files when they are being deleted. / q Specifies the silent mode. You are not prompted to confirm deletion. / a [:] Delete files based on the following file attributes: r - File read-only h - File hidden i - Not content indexed files s - File system a - File is ready for archiving l - Reparse point - Prefix means 'no' /? Show help at the command prompt.Note
Careful:
- If you use the del command to delete a file from the drive, you cannot do this.
- If you use / p, the del command will display the name of a file and send the following message:
`FileName, Delete (Y/N)?` To confirm the deletion, press Y. To cancel the deletion and display the next file name (that is, if you specified a group of files), press N. To stop the **del** command, press CTRL+C.
- If you have the command extension, / s will display the name of any file that is not found, instead of displaying the name of the file being deleted (ie the behavior is reversed).
- If you specify a folder in Names, all files in the folder will be deleted. As an example,, the following command deletes all files in the Work folder :
del work
- You can use wildcards ( * and ? ) To delete multiple files at once. However, to avoid deleting files unconsciously, you should be cautious when using wildcards with the del command. As an example,, if you type the following command:
del *.*
The del command will display the following prompt:
Are you sure (Y/N)?
To delete all files in the current directory, press Y and then press ENTER. To cancel deleting, press N and then press ENTER.
Note:
- Before you can use wildcards with the del command , use the same wildcard with the dir command to list all files that will be deleted.
- Del command , with different parameters, is available from Recovery Console.
As an example,
To delete all files in a folder named Test on drive C , enter one of the following options:
del c:test del c:test*.*
- Compact command in Windows
- The convert in Windows command
- Comp command in Windows
FAQ
What should you know about as an example,?
To delete all files in a folder named Test on drive C, enter one of the following options:
What is Del Command in Windows?
The del command deletes one or more files.
Why is Del Command in Windows important?
A clear understanding of Del Command in Windows helps you make informed decisions, avoid common mistakes, and use the relevant tools or techniques more effectively.
Reader Comments 0
Sign in with email or Google to join the discussion.