命令行大全

del

秃噜豆儿 发表于 2020-06-23 10:02浏览次数:

del命令用于删除计算机中的文件。

使用rmdir或deltree命令删除目录。

Use the rmdir or deltree command to delete directories.

查看英文版

目录:

1 del 运行系统环境

2 del 语法

3 del 示例

del 运行系统环境

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

del 语法

Windows 2000,Windows XP和更高版本的语法

删除一个或多个文件。

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 = 准备归档的文件
- = 前缀,表示没有(例如,-h表示未隐藏)。

如果启用了命令扩展,则DEL和ERASE更改如下:

  • / S开关的显示语义是相反的,因为它只显示删除的文件,而不显示找不到的文件。

Windows 2000和Windows XP故障恢复控制台语法

删除一个文件。

DEL [drive:][path]file name
DELETE [drive:][path]file name
[drive:][path]file name 指定要删除的文件。

删除仅在当前Windows安装的系统目录,可移动媒体,任何硬盘分区的根目录或本地安装源中运行。

Del和Delete不支持可替换参数(通配符)。

Windows 95、98和ME语法

删除一个或多个文件。

DEL [drive:][path]file name [/P]
ERASE [drive:][path]file name [/P]
[drive:][path]file name 指定要删除的文件。使用通配符指定多个文件。
/P 在删除每个文件之前提示您进行确认。
Windows 2000, Windows XP, and later syntax

Deletes one or more files.

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 (e.g., -h for not hidden).

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.
Windows 2000 and Windows XP Recovery Console syntax

Deletes one file.

DEL [drive:][path]file name
DELETE [drive:][path]file name
[drive:][path]file name Specifies the file to delete.

Delete only operates in the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.

Del and delete do not support replaceable parameters (wildcards).

Windows 95, 98, and ME syntax

Deletes one or more files.

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.

查看英文版

查看中文版

del 示例

del test.tmp

如果文件存在,则删除当前目录中的test.tmp。

del c:\windows\test.tmp

如果存在,请删除Windows目录中的c:\ windows \ test.tmp。

del c:\windows\temp\*.*

*(星号)是通配符。*。*表示您要删除c:\ windows \ temp目录中的所有文件。

del c:\windows\temp\?est.tmp

?(问号)是一个字母的单个通配符。在以上示例中使用此命令将删除所有以“ est.tmp”结尾的文件,例如“ pest.tmp”或“ test.tmp”。

del test.tmp

Deletes the test.tmp in the current directory, if the file exists.

del c:\windows\test.tmp
del c:\windows\test.tmp

Delete the c:\windows\test.tmp in the Windows directory if it exists.

del c:\windows\temp\*.*

The * (asterisks) is a wild character. *.* indicates you would like to delete all files in the c:\windows\temp directory.

del c:\windows\temp\?est.tmp

The ? (question mark) is a single wild character for one letter. The use of this command in the above example would delete any file ending with "est.tmp," such as "pest.tmp" or "test.tmp."

在Microsoft Windows中,已删除的项目转到回收站。请记住,从MS-DOS或Windows命令行删除文件不会将它们发送到回收站。

In Microsoft Windows, deleted items go to the Recycle Bin. Keep in mind that deleting files from MS-DOS or the Windows command line does not send them to the Recycle Bin.

查看英文版

查看中文版