开发者

How to delete files in multiple unknown folders from a single bat file?

开发者 https://www.devze.com 2023-02-12 13:04 出处:网络
Suppose I don\'t know names of all the folders in a directory. I want to delete all the .exe file in those folders fr开发者_运维问答om a single bat file. What will be the command? Is it possible?

Suppose I don't know names of all the folders in a directory. I want to delete all the .exe file in those folders fr开发者_运维问答om a single bat file. What will be the command? Is it possible?

cd ?
del *.exe 


Try to do

del /s *.exe

/S stands for delete from all Subfolders (DELTREE)


Using FOR to iterate over directories:

for /d %i in (*.*) do del %i\*.exe
0

精彩评论

暂无评论...
验证码 换一张
取 消