|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『楼 主』:
求助!如何寻找所需的并删除文件夹(已解)
使用 LLM 解释/回答一下
由于WINDOWS升级会在%windir%目录下生成$****$的文件夹,由于一般情况下这些文件夹没什么作用所以想做个批处理来把这些文件夹给删除掉,请高手们解答一下。
就是如何把%windir%目录下全部升级备份文件夹$****$及其下的全部内容给删除?删除文件可以用通配符,但我用del却行不通。用rd的话同样是要全名的。怎样做才可以使用上通配符?
Last edited by austion on 2006-7-13 at 19:22 ]
Since Windows upgrades generate $****$ folders in the %windir% directory, and generally these folders are useless, so I want to make a batch script to delete these folders.
That is, how to delete all the upgrade backup folders $****$ in the %windir% directory and all their contents? Deleting files can use wildcards, but del doesn't work. Using rd also requires the full name. How to use wildcards?
Last edited by austion on 2006-7-13 at 19:22 ]
|
|
2006-7-3 09:23 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
for /d /r %a in (c:\windows\$*$) do @rd /s /q "%a"
没有经过测试............
for /d /r %a in (c:\windows\$*$) do @rd /s /q "%a"
Not tested yet............
|
|
2006-7-3 10:06 |
|
|
doudou
新手上路

积分 6
发帖 3
注册 2006-7-3
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
for /f %i in ('dir %systemroot% /adh /b ^|find "$NtUninstall"') do @echo %systemroot%\%i
for /f %i in ('dir %systemroot% /adh /b ^|find "$NtUninstall"') do @echo %systemroot%\%i
|
|
2006-7-3 10:12 |
|
|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
经测试,2楼的:
此时不应有do
3楼的:
命令语法不正确
以上是测试结果。
After testing, the content from the 2nd floor:
There should not be "do" at this time
The content from the 3rd floor:
The command syntax is incorrect
The above are the test results.
|
|
2006-7-3 15:57 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我想你还是看看吧,我觉得没有什么问题,)符号后面有个空格然后才是DO呢,三楼语法的问题是他单引号里错了,得改成'"........."'或者'.......^| .........'这样的形式才可以
I think you'd better take a look. I think there's no problem. There's a space after the ) symbol and then comes DO. The grammar problem on the third floor is that he made a mistake in the single quotes. It should be changed to '"........."' or '.......^| .........' and so on.
|
|
2006-7-3 17:11 |
|
|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
我是按照你写的来的,do前面是有空格的。
I followed what you wrote, and there is a space before do.
|
|
2006-7-3 18:52 |
|
|
无奈何
荣誉版主
      
积分 1338
发帖 356
注册 2005-7-15
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
换一下语句试一下
for /D %a in ("%windir%\$*$") do @rd /s /q "%a"
无奈何 2006-07-03 21:42
Try changing the sentence.
for /D %a in ("%windir%\$*$") do @rd /s /q "%a"
Wunaihe 2006-07-03 21:42
|

☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul
|
|
2006-7-3 21:49 |
|
|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
bagpipe:
三楼语法的问题是他单引号里错了,得改成'"........."'或者'.......^| .........'这样的形式才可以
那要怎样改呢?我对for比较陌生,不太懂。
无奈何:
不知道为什么,在我的机子里使用你给的语句会说:此时不应有windira"
其它机子上没验证
bagpipe:
The grammar problem on the third floor is that he made a mistake in the single quotes. It should be changed to the form of '"........."' or '.......^| .........' to be correct.
Then how to change it? I'm not familiar with for and don't understand it very much.
Helpless:
I don't know why, when I use the statement you gave on my computer, it says: "At this time, there should not be windira"
It hasn't been verified on other computers
|
|
2006-7-4 06:37 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
austion对不起了,您的问题我解决不了了.............
Austion, I'm sorry, I can't solve your problem...
|
|
2006-7-4 08:50 |
|
|
220110
荣誉版主
      
积分 718
发帖 313
注册 2005-9-26
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
此时不应有windira
是 windir !!!
There should be no windira at this time
It's windir!!!
|
|
2006-7-4 09:26 |
|
|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
我是按照无奈何得输入的,但是结果的确是显示:此时不应有windira"
不是windir也不是windira却是说windira“
我的输入是 for /D %a in ("%windir%\$*$") do @rd /s /q "%a"
写的是%windir%的久是显示结果却是:此时不应有windira"
I entered it as I had to, but the result indeed shows: "At this time there should not be windira"
It's not windir or windira but it says windira "
My input is for /D %a in ("%windir%\$*$") do @rd /s /q "%a"
I wrote %windir% but the result shows: "At this time there should not be windira"
|
|
2006-7-4 09:56 |
|
|
doudou
新手上路

积分 6
发帖 3
注册 2006-7-3
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
赫赫,真的假的,我可是测试好了再贴上来的
楼主要在批处理用得把%i替换成%%i
我是直接在命令行输入的
哎
Heheh, is it true or false, I really tested it before posting it.
The building owner needs to replace %i with %%i in the batch processing.
I directly input it in the command line.
Hey
|
|
2006-7-4 10:18 |
|
|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
doudou:
我也按照你说的去做了把%i替换成%%i
没弹出问题,但是就是还没能把需要的文件夹删除你看图吧
Last edited by austion on 2006-7-7 at 08:54 ]
doudou:
I also did as you said and replaced %i with %%i.
There was no problem popping up, but still couldn't delete the required folder. Look at the picture.
Last edited by austion on 2006-7-7 at 08:54 ]
|
|
2006-7-4 15:57 |
|
|
austion
初级用户
 
积分 178
发帖 82
注册 2006-5-12
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
顶上去,希望有高手帮帮忙
Push it up, hope there are experts to help
|
|
2006-7-7 08:55 |
|
|
flysp
中级用户
  
积分 207
发帖 41
注册 2004-10-24
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
@echo off
dir /s /b /ah c:\$*$>clean.txt
for /f %%i in (clean.txt) do @rd /s /q "%%i"
@echo off
dir /s /b /ah c:\$*$>clean.txt
for /f %%i in (clean.txt) do @rd /s /q "%%i"
|
|
2006-7-9 10:14 |
|