Tural Ali
Tural Ali

Reputation: 23240

Recursively delete hidden files with exact extension

When I execute following line on CMD, it doesn't delete hidden files. What's wrong with this function?

For /r %%i in (*.mta) do del "%%i"

Upvotes: 0

Views: 2184

Answers (1)

Ben
Ben

Reputation: 52863

Don't do it in a loop.

del /S /A:H <folder_name> *.mta

deletes recursively in subfolders, with the attributes, hidden; help del in cmd will give you more options.

Upvotes: 3

Related Questions