Writing a batch file to delete files with wildcards

Posted by iamthejeff on Stack Overflow See other posts from Stack Overflow or by iamthejeff
Published on 2010-03-31T22:00:50Z Indexed on 2010/03/31 22:03 UTC
Read the original article Hit count: 236

Filed under:
|
|

I have multiple websites set up in the same folder, and I want to create a batch file that will delete the cache in each of them without having to add a new line for each site. For example I am using this:

del /S /Q D:\www\site-name\cache\*

Which works, but I have to add a new line for every site in D:\www. The del command doesn't support:

del /S /Q D:\www\*\cache\*

So what is a better way to do this?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about batch