erase
舞夕之 发表于 2020-06-28 17:31浏览次数:
ERASE命令用于从计算机的硬盘驱动器和其他存储设备中删除文件。
The erase command is used to remove files from your computer's hard drive as well as other storage devices.
目录:
1 erase 运行系统环境
2 erase 语法
3 erase 示例
erase 运行系统环境
Windows 95
Windows 98
Windows xp
Windows vista
Windows 2000
Windows 7
Windows 8
Windows 10
Windows NT
Windows ME
All Versions of MS-DOS
erase 语法
Windows命令行语法
DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
names
|
指定一个或多个文件或目录的列表。通配符可用于删除多个文件。如果指定了目录,则该目录中的所有文件都将被删除。
|
/P
|
在删除每个文件之前提示确认。
|
/F
|
强制删除只读文件。
|
/S
|
从所有子目录中删除指定的文件。
|
/Q
|
静默模式,不询问是否确定删除全局通配符。
|
/A
|
根据属性选择要删除的文件。
|
attributes
|
R - 只读文件
S - 系统文件
H - 隐藏文件
A - 准备存档的文件
- 前缀的意思是没有
|
如果启用了命令扩展,则DEL和ERASE更改如下:
/S开关的显示语义是相反的,因为它只显示已删除的文件,而不显示它找不到的文件。
MS-DOS Synta的早期版本
>DEL [drive:][path]file name [/P]
ERASE [drive:][path]file name [/P]
[drive:][path]
|
指定要删除的文件。使用通配符指定多个文件。
|
/P
|
在删除每个文件之前提示确认。
|
Windows command line syntax
DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
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 in 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, DEL and ERASE change as follows:
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.
Early versions of MS-DOS syntax
>DEL [drive:][path]file name [/P]
ERASE [drive:][path]file name [/P]
[drive:][path]file name
|
Specifies the file(s) to delete. Specify multiple files by using wildcards.
|
/P
|
Prompts for confirmation before deleting each file.
|
erase 示例
erase c:\windows\*.tmp
删除所有以TMP扩展名结尾的文件(即临时文件)。
erase c:\windows\*.tmp
Delete any files that end with the TMP extension (i.e. temporary file).
运行此命令时,您不会收到确认提示。一旦执行,所有文件都将被删除,除非它们具有只读属性并且未使用/F开关。
You will not receive a confirmation prompt when running this command. Once executed, all files will be deleted unless they have a read-only attribute and the /F switch is not being used.