Posted by: Khairey June 10, 2009
Batch File -- Sys Admins please help
Login in to Rate this Post:     0       ?        
I normally use powershell for scripting on windows.
Keyword here.. powershell.. explore it, you will love it if you are more inclined to do unix like scripting on windows.

The above script will delete the folder I think. To delete files use this WQL instead:
Select * from CIM_DataFiles where Drive='C:' and Path='\\somefolder\\' and Extension='log' and LastModified < '01/01/2009 00:00:00'

You can easily use some date function and pass on that query.
Read Full Discussion Thread for this article