【发布时间】:2014-04-04 19:31:25
【问题描述】:
我想批量删除磁盘c:\上各个文件夹中的所有文件*.bak。
谁能帮帮我?
例如:
all c:
del *.bak /s /a
谢谢。
【问题讨论】:
我想批量删除磁盘c:\上各个文件夹中的所有文件*.bak。
谁能帮帮我?
例如:
all c:
del *.bak /s /a
谢谢。
【问题讨论】:
在进行全局删除时要格外小心!您可能会得到比您要求的更多的东西,尤其是在头疼和浪费时间恢复系统方面。
话虽如此:
C:
cd \
del /s /q /f *.bak
如需更多信息,请在命令提示符下键入 del /?,这会在 Windows 7 中为您提供:
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 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
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.
【讨论】:
可以是单个命令。
del /s /q /f c:\*.bak
【讨论】:
del /?,您会得到:/f = 强制删除只读文件。 /s = 从当前目录和所有子目录中删除指定文件。显示正在删除的文件的名称。 /q = 指定安静模式。系统不会提示您确认删除。