中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 11:36
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Does a full disk search include all folders?
Printable Version  1,464 / 7
Floor1 caozhoubei Posted 2008-12-22 23:07
初级用户 Posts 15 Credits 34 From 四川
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~~!
Floor2 Climbing Posted 2008-12-23 09:42
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
for %i in (c d e f g h i j k ...) do del /f/q/s/a %i:\*.tmp
Floor3 caozhoubei Posted 2008-12-23 11:46
初级用户 Posts 15 Credits 34 From 四川
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!
Floor4 HAT Posted 2008-12-23 13:19
版主 Posts 5,017 Credits 9,023
Go to the batch processing room to search for "full disk search"

Q: How to use the forum's search function to solve your own problems?
A: Reference: http://www.cn-dos.net/forum/viewthread.php?tid=44122#pid308085
Floor5 Climbing Posted 2008-12-23 14:01
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
What I gave is a full-disk search, including subfolders. Note the /s parameter. The /a parameter just includes all hidden files.
Floor6 hxsym Posted 2010-03-16 08:39
新手上路 Posts 1 Credits 1
Learning
Floor7 zlsanhong Posted 2010-03-16 17:08
新手上路 Posts 14 Credits 15
@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
Floor8 wcf147 Posted 2010-04-29 22:08
新手上路 Posts 3 Credits 3
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023