- 帖子
- 40
- 积分
- 64
- 技术
- 1
- 捐助
- 0
- 注册时间
- 2012-11-7
|
[其他] 每天一文:del命令微软官网翻译。12.11.12
与该命令使用方法相关的任何问题可以在回帖中提问。我尽力解答
Del
Published: April 17, 2012
发表:2012.4.17
Updated: April 17, 2012
更新:2012.4.17
Deletes one or more files. This command is the same as the erase command.
删除一个或多个文件,这个命令和erase命令一样。
For examples of how to use this command, see Examples.
例如如何使用这个命令,查看例子.
Syntax
语法
________________________________________
del [/f] [/q] [/a[:]<Attributes>] <Names>
erase [/f] [/q] [/a[:]<Attributes>] <Names>
Parameters
参数
________________________________________
Parameter Description
参数 描述
<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 the specified file.
删除文件之前提示确认。
---------------------------------------------------------------------------------------------------------------------------------
/f Forces deletion of read-only files.
强制删除只读文件。
---------------------------------------------------------------------------------------------------------------------------------
/s Deletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted.
从当前目录和所有子目录中删除指定的文件。在删除的时候显示被删除的文件名。
---------------------------------------------------------------------------------------------------------------------------------
/q Specifies quiet mode. You are not prompted for delete confirmation.
指定静默模式。你不会被提示是否确认删除。
---------------------------------------------------------------------------------------------------------------------------------
/a[:]<Attributes> Deletes files based on the following file attributes:
删除基于以下属性的文件:
---------------------------------------------------------------------------------------------------------------------------------
r Read-only files
只读文件
---------------------------------------------------------------------------------------------------------------------------------
h Hidden files
隐藏文件
---------------------------------------------------------------------------------------------------------------------------------
i Not content indexed files
无内容索引文件
--------------------------------------------------------------------------------------------------------------------------------
s System files
系统文件
--------------------------------------------------------------------------------------------------------------------------------
a Files ready for archiving
准备存档的文件
--------------------------------------------------------------------------------------------------------------------------------
l Reparse points
重分析点
-------------------------------------------------------------------------------------------------------------------------------
- Prefix meaning 'not'
- 前缀表示’否’
--------------------------------------------------------------------------------------------------------------------------------
/? Displays help at the command prompt.
在命令提示处显示帮助。
--------------------------------------------------------------------------------------------------------------------------------
Remarks
备注
________________________________________
Caution
注意
If you use del to delete a file from your disk, you cannot retrieve it.
如果你使用del删除磁盘上的文件,你将无法恢复它。
• If you use /p, del displays the name of a file and sends the following message:
如果你使用/p,del显示文件的名字并发送以下信息:
FileName, Delete (Y/N)?
文件名,删除(y/n)?
To confirm the deletion, press Y. To cancel the deletion and display the next file name (that is, if you specified a group of files), press N. To stop the del command, press CTRL+C.
如果要删除,按Y。如果取消删除显示下一个文件名(也就是说,你指定了一组文件),按N。如果要停下del命令,按CTRL+C
• If you disable command extensions, /s displays the names of any files that were not found instead of displaying the names of files that are being deleted (that is, the behavior is reversed).
如果你关闭命令扩展,/s显示已经被删除的文件而不是正在删除的文件(这意味着语法是颠倒的)。
• If you specify a folder in Names, all of the files in the folder are deleted. For example, the following command deletes all of the files in the \Work folder:
如果你指定一个文件夹名,文件夹里的所有文件都会删除。例如,下面的命令删除\Work folder文件夹中的所有文件:
• del \work
• You can use wildcards (* and ?) to delete more than one file at a time. However, to avoid deleting files unintentionally, you should use wildcards cautiously with the del command. For example, if you type the following command:
你可以使用通配符(*和?)来同时删除不止一个文件。然而,为了避免不小心删除文件,你需要小心谨慎的使用通配符。例如,如果你输入以下的命令:
• del *.*
The del command displays the following prompt:
Del命令显示以下的提示:
Are you sure (Y/N)?
你确定吗?(Y/N)
To delete all of the files in the current directory, press Y and then press ENTER. To cancel the deletion, press N and then press ENTER.
为了删除当前目录下的所有文件,按Y然后按ENTER。取消删除动作,按N然后按ENTER.
Note
注意
Before you use wildcard characters with the del command, use the same wildcard characters with the dir command to list all the files that will be deleted.
在del命令中使用通配符之前,使用同样的通配符在dir命令中来列出所有要删除的文件。
• The del command, with different parameters, is available from the Recovery Console.
Del命令,不同的参数一样适用于故障恢复台。
Examples
例子
________________________________________
To delete all the files in a folder named Test on drive C, type either of the following:
为了删除c盘test文件夹中的所有文件,输入以下其中一个命令:
del c:\test
del c:\test\*.*
To delete all files with the .bat file name extension from the current directory, type:
为了删除当前目录下所有的.bat扩展名文件,输入:
del *.bak
To delete all read-only files in the current directory, type:
为了删除当前目录中所有的只读文件,输入:
del /a:r *.* |
-
1
评分人数
-
|