How to delete files in multiple unknown folders from a single bat file?
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
精彩评论