|
caozhoubei
初级用户
 
积分 34
发帖 15
注册 2008-10-10 来自 四川
状态 离线
|
『楼 主』:
全盘搜索包括所有文件夹?
使用 LLM 解释/回答一下
是这样的,我想用DOS编写全盘清理某个文件。
就是没有想明白怎么样才能实现快速全盘搜索这个文件,比如:autorun.inf
我都是这样清理的,
del /f /q c:\autorun.inf
del /f /q d:\autorun.inf
del /f /q e:\autorun.inf
......
这样很死板不活,万一这个文件不在c,d,e...根目录怎么办,
我想了好久都没有想通,反复看DOS书,都没有找到我想要的
请高手帮忙,解决此问题,这样我就可以做我想要清理文件的BAT了,我写好了给你门分享~~!
This is like this. I want to use DOS to clean up a certain file throughout the disk.
That is, I haven't figured out how to achieve quickly searching for this file throughout the disk, for example: autorun.inf
I all clean up like this,
del /f /q c:\autorun.inf
del /f /q d:\autorun.inf
del /f /q e:\autorun.inf
......
This is very rigid and not flexible. What if this file is not in the root directory of c, d, e...?
I have thought about it for a long time and haven't figured it out. I have repeatedly read DOS books and haven't found what I want.
Please help the expert to solve this problem. Then I can make the BAT for cleaning the file I want. I will write it and share it with you guys~~!
|
|
2008-12-22 23:07 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
for %i in (c d e f g h i j k ...) do del /f/q/s/a %i:\*.tmp
for %i in (c d e f g h i j k ...) do del /f/q/s/a %i:\*.tmp
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2008-12-23 09:42 |
|
|
caozhoubei
初级用户
 
积分 34
发帖 15
注册 2008-10-10 来自 四川
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
2楼的我测试过了。好象不行,我要的是全盘,包括所有文件夹
我记得我看过一篇这样的文章,我只记得有这样一个命令,attrib ,还有一个命令我想不起来了,可以查找全盘包括所有文件夹.
那篇文章我没有保存,现在想想有的遗憾!
What I tested on the 2nd floor doesn't seem to work. What I want is the entire disk, including all folders. I remember I read an article like this. I only remember there is a command called attrib, and another command I can't remember, which can search the entire disk including all folders. I didn't save that article, and now I feel a bit regretful!
|
|
2008-12-23 11:46 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2008-12-23 13:19 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我给出的那个就是全盘搜索,包括子文件夹。注意/s参数。/a参数刚包括所有的隐藏文件。
What I gave is a full-disk search, including subfolders. Note the /s parameter. The /a parameter just includes all hidden files.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2008-12-23 14:01 |
|
|
hxsym
新手上路

积分 1
发帖 1
注册 2010-3-15
状态 离线
|
|
2010-3-16 08:39 |
|
|
zlsanhong
新手上路

积分 15
发帖 14
注册 2010-2-26
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
@echo off
以下为搜索并复制到D:\2
请自己参考。谢谢。
for %%? in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
for /f %%i in ('dir %%?:\*.doc /s/b') do xcopy "%%i" d:\2\
set "ts=%%~dpa" & goto next
)
)
pause>nul | set/p=文件不存在。请按任意键退出. . . & exit /b
@echo off
The following is to search and copy to D:\2
Please refer to it yourself. Thank you.
for %%? in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
for /f %%i in ('dir %%?:\*.doc /s/b') do xcopy "%%i" d:\2\
set "ts=%%~dpa" & goto next
)
)
pause>nul | set/p=File does not exist. Please press any key to exit. . . & exit /b
|
|
2010-3-16 17:08 |
|
|
wcf147
新手上路

积分 3
发帖 3
注册 2010-4-19
状态 离线
|
|
2010-4-29 22:08 |
|