Lets say they are in a folder like~$OriginalNameOfMyFile.xlsm
S:\Data
and its sub-folders and their sub-folders
I tried using
Code: Select all
forfiles /s /m "~$*.xlsm" /c "cmd /c del @path" /p "S:\Data"
Code: Select all
for /r "S:\Data" %x in (~$*.xlsm) do del "%x"
Was it because such temporary files have the hidden attribute applied to them?