Command Prompt for Windows




Command DEL or ERASE

Function:

Deletes one or more files.

Syntax:

DEL [drive:][path]filename [/A[[:]attributes]] [/F] [/P] [/Q] [/S] [/Y]
ERASE [drive:][path]filename [/A[[:]attributes]] [/F] [/P] [/Q] [/S] [/Y]
[drive:][path]filenameSpecifies the file(s) to delete.
/ADelete files with specified attributes, where attributes are
   RRead-only files
   HHidden files
   AArchive files
   SSystem files
   -Prefix meaning NOT
/FForce deleting of read-only files.
/PPrompts for confirmation before deleting each file.
/Q or /YQuite mode or assume YES for all questions. Questions are not displayed.
/SProcess sub-directories.

Note:

When the /S switch and either *.* or a directory name is specified for parameter filename, then command DEL will also remove all the directories, including sub-directories, after deleting all the files, otherwise only the specified file or files are deleted and there is no attempt made to remove any directories or sub-directories.

Also see command DELBUT.