# batch/cmd to remove folders older than a certain date starting at a particular folder



## sacksn (Mar 22, 2011)

Hi

I have a number of folders in a structure and need a batch file to delete folders older than 2 days (by modified date). The awkward part revolves around the fact that the folders that require deleting are seperated in the file structure by the hostname that the folders originated from. eg: -

[folder root]
|
|-[folder1(hostname)]
| |-[folder2]
|
|-[folder1(hostname)]
| |-[folder2]
|
|-[folder1(hostname)]
| |-[folder2]
|

In other words, starting at the root level I want to be able to delete all [folder2] level folders modified by (older than) more than 48hrs. The script/batch needs to suppress prompts as this will need to be automated.

if anyone can help that would be great!!! 
Thanks in advance


----------

