Search notes:

cmd.exe - del

del is a cmd.exe built-in command to delete one or more files.
del is affected by whether command extensions are enabled or disabled.
C:\> del [options] file-one.txt file-two.txt …

Options

/P Prompt for confirmation before deleting each file.
/F Force deleting of read-only files.
/S Delete specified files from all subdirectories.
/Q Quiet mode, do not ask if ok to delete on global wildcard
/A[:]attributes Selects files to delete based on attributes
These options are case insensitive: /p has the same effect as /P etc.

/a Attributes

The attributes that can be specified with /A are
R Read-only files
H Hidden files
I Not content indexed Files
O Offline files
S System files
A Files ready for archiving
L Reparse Points
These attribute characters can be prefixed with a hyphen (-) to reverse its meaning.

/q has no effect if file does not exist

The /q flag only prevents verification if files can be deleted if used with wildcards.
If a file that does not exist is tried to be deleted, cmd.exe will respond with Could Not Find inexisting-file.txt, even if used with /q.
In order to prevent such an error message from being printed, stderr needs to be redirected to nul:
C:\> del inexisting-file.txt 2>nul

See also

Use rmdir to delete directories.
cmd.exe: Built-in commands

Index