[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件操作] 怎么批量删除*font*文件夹

RD貌似不支持通配符
而且*font*文件夹  所在的文件夹,文件夹极多,枚举可能不现实

举一个失败的例子方便理解吧
RD /s /q "c:\Windows\WinSxS\*font*"

回复 2# 不知道是谁


    如果要反过来,除了*font*文件夹以外的文件夹全部删除,怎么写呢

TOP

本帖最后由 hentai87 于 2020-4-30 19:20 编辑

回复 8# 不知道是谁


D:\ZT\msmg9.8\Mount\Install\Windows\SystemApps>set str=D:\ZT\msmg9.8\Mount\Install\Program Files\WindowsApps

D:\ZT\msmg9.8\Mount\Install\Windows\SystemApps>for /F "delims=" %i in ('dir /ad /b /s "D:\ZT\msmg9.8\Mount\Install\Program Files\WindowsApps"|find /v "Microsoft.UI.Xaml*"') do RD /S /Q "%i"

D:\ZT\msmg9.8\Mount\Install\Windows\SystemApps>RD /S /Q "D:\ZT\msmg9.8\Mount\Install\Program Files\WindowsApps\Microsoft.UI.Xaml123123123"

D:\ZT\msmg9.8\Mount\Install\Windows\SystemApps>RD /S /Q "D:\ZT\msmg9.8\Mount\Install\Program Files\WindowsApps\New folder"

D:\ZT\msmg9.8\Mount\Install\Windows\SystemApps>pause
失败了,删了不该删的Microsoft.UI.Xaml123123123

TOP

返回列表