del
Deletes one or more files. Windows commands reference
On Windows, DOS
Windows
Deletes one or more files. This command performs the same actions as the erase command. The del command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE). WARNING: If you use del to delete a file from your disk, you can't retrieve it.
del [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>erase [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>del \workdel *.*
To delete all the files in a folder named Test on drive C, type either of the following
del c:\test
del c:\test\*.*IdentifyTo delete all the files in a folder where the folder has a space in its name, the full path needs to be wrapped in double quotes. Type either of the following
del "c:\test folder\"
del "c:\test folder\*.*"IdentifyTo delete all files with the .bat file name extension from the current directory, type
del *.batIdentifyTo delete all read-only files in the current directory, type
del /a:r *.*Identify/aDeletes files based on the following file attributes: r Read-only files h Hidden files i Not content indexed files s System files a Files ready for archiving l Reparse points - Used as a prefix meaning 'not' . Windows commands reference<names>Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted./pPrompts for confirmation before deleting the specified file./fForces deletion of read-only files./sDeletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted./qSpecifies quiet mode. You are not prompted for delete confirmation./a[:]<attributes>Deletes files based on the following file attributes:
- r Read-only files
- h Hidden files
- i Not content indexed files
- s System files
- a Files ready for archiving
- l Reparse points
- - Used as a prefix meaning 'not'./?Displays help at the command prompt.Windows
Delete one or more files. In PowerShell, this command is an alias of Remove-Item. This documentation is based on the Command Prompt (cmd) version of del.
Delete one or more files or patterns
del file_pattern1 file_pattern2 ...IdentifyPrompt for confirmation before deleting each file
del file_pattern /pIdentify/pPrompts for confirmation before deleting the specified file. Windows commands referenceForce the deletion of read-only files
del file_pattern /fIdentify/fForces deletion of read-only files. Windows commands referenceTrips 1 Sigma rule: lowFile Deletion Via Del by frack113
Recursively delete file(s) from all subdirectories
del file_pattern /sIdentify/sDeletes specified files from the current directory and all subdirectories. Windows commands referenceTrips 1 Sigma rule: lowFile Deletion Via Del by frack113
Do not prompt when deleting files based on a global wildcard
del file_pattern /qIdentify/qSpecifies quiet mode. Windows commands referenceTrips 1 Sigma rule: lowFile Deletion Via Del by frack113
Delete files based on specified attributes
del file_pattern /a attributeIdentify/aDeletes files based on the following file attributes: r Read-only files h Hidden files i Not content indexed files s System files a Files ready for archiving l Reparse points - Used as a prefix meaning 'not' . Windows commands referenceDisplay help and list available attributes
del /?Identify/?Displays help at the command prompt. Windows commands reference