CmdID

CmdID / Commands

del

Deletes one or more files. Windows commands reference

On Windows, DOS

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

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 \work
del *.*

To delete all the files in a folder named Test on drive C, type either of the following

del c:\test del c:\test\*.*Identify

To 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\*.*"Identify

To delete all files with the .bat file name extension from the current directory, type

del *.batIdentify

To 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

from tldr-pages, CC BY 4.0

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 ...Identify

Prompt for confirmation before deleting each file

del file_pattern /pIdentify
/pPrompts for confirmation before deleting the specified file. Windows commands reference

Force the deletion of read-only files

del file_pattern /fIdentify
/fForces deletion of read-only files. Windows commands reference

Trips 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 reference

Trips 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 reference

Trips 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 reference

Display help and list available attributes

del /?Identify
/?Displays help at the command prompt. Windows commands reference

Delete one or more files.

Delete a file

DEL path/to/fileIdentify

Delete all files matching a pattern

DEL path/to/*.extIdentify