Windows – How to delete all files within subdirectories matching a given wildcard in Windows

command linewildcardswindows

I would like to delete all files on a Windows server matching this wildcard:

E:\Cache\*\*\*_ROOT\a*_SYMBOL\weekly*

In linux, I could just put an rm -rf in front of it and it would work. If I try something similar in Windows, it just gives me:

The filename, directory name, or volume label syntax is incorrect.

Any ideas about what I can do?

Best Answer

Use Power Shell, which comes built-in in Win7

for example, rm -rf would translate to:

Remove-Item E:\Cache\*\*\*_ROOT\a*_SYMBOL\weekly* -force
Related Question