I am trying to delete all folders on all drives with the above naming pattern, however only on the first folder level, i.e directly below the drive letter, like for example:
F:\this folder's name contains FOO and should be deleted
...without confirmation nor error message (e.g. in case no folders are found), with a batchfile.
I've found this: delete all folders with tmp in name using batch file and am wondering if the solution from there is a good starting point?
@echo off
set dir="c:\FOLDERLOCATION\"
FOR /D /R %dir% %%X IN (*.tmp) DO RMDIR /S /Q "%%X"
pause
exit