How to use DEL/ERASE Command

DEL/ERASE


Purpose:Deletes one or more files.

Syntax:DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
                
                ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

Prameters:

 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.

  /P                  Prompts 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                 Selects files to delete based on attributes
  attributes    R  Read-only files            S  System files
                       H  Hidden files               A  Files ready for archiving
                       I  Not content indexed Files  L  Reparse Points
                       -  Prefix meaning not

Example 1:DEL D:\test.t xt

Example 2: DEL /P D:\test.txt asks for confirmation to delete

Example 3: DEL /F D:\test.txt deletes read only files

Example 4: DEL /S D:\New folder\test.txt deletes files in folders


Comments

Popular posts from this blog

How to use DIR Command

How to use ENDLOCAL/SETLOCAL