(delete/erase)
删除一个或数个文件。
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
names
指定一个或数个文件或目录列表。通配符可被用来
删除多个文件。如果指定了一个目录,目录中的所
有文件都会被删除。
/P
删除每一个文件之前提示确认。
/F
强制删除只读文件。
/S
从所有子目录删除指定文件。
/Q
安静模式。删除全局通配符时,不要求确认。
/A
根据属性选择要删除的文件。
attributes R 只读文件
S 系统文件
H 隐藏文件
A 存档文件
- 表示“否”的前缀
如果命令扩展名被启用,DEL 和 ERASE 会如下改变:
/S 开关的显示句法会颠倒,即只显示已经删除的文件,而不显示找不到的文件。
Deletes one or more
files.
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
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
-
Prefix meaning not
If Command Extensions are enabled
The display semantics of the /S
switch are reversed in that it shows you only the files that are deleted, not
the ones it could not find.