How to delete files from several unknown folders from one bat file?

Suppose I do not know the names of all the folders in the directory. I want to delete the entire .exe file in these folders from one bat file. What will be the team? Is it possible?

cd ?
del *.exe 
+3
source share
2 answers

Try to do

del /s *.exe

/ S means delete from all subfolders (DELTREE)

+4
source

Using FOR to iterate over directories:

for /d %i in (*.*) do del %i\*.exe
+3
source

Source: https://habr.com/ru/post/1793151/


All Articles