This is definitely a job for PowerShell!
$now = Get-Date
Get-ChildItem -Filter Archive -Recurse | Where-Object {$_.PSIsContainer} |
Get-ChildItem | Where-Object {($_.PSIsContainer -eq $false) -and (($now -
$_.LastWriteTime) -ge 60)} | Remove-Item -WhatIf
Here's what it does:
1. It gets the current date and time and stores it in the now variable.
2. It recursively walks through the directory tree starting at the current
directory. It only returns objects (files or folders) with the name
Archive. For each of those files or folders, it filters out any that are
not containers (the files). With whatever is left, it calls Get-ChildItem
to get the items in the folder (files and folders). For each of those, it
filters out any that are containers (the folders) and any that are not
containers but that are less than 60 days old. Finally, with the files that
are left (which are more than 60 days old), it pretends to remove them and
tells you what it would do if -whatif wasn't there. To actually remove
them, just get rid of the -whatif at the end.
Run this as is first, then validate the data to make sure it's going to do
what you want (manually check the files it would remove). Then remove the
whatif and let it do your work for you.
And all in two little lines of script!

-
Kirk Munro
Poshoholic
http://poshoholic.com
"hibbarcd" <hibbarcd@xxxxxx> wrote in message
news:9C612E8C-03E3-4A12-A793-CD076227350A@xxxxxx
>I have been looking for a vb script that would satisfy these requirements
>but
> I'm told powershell will perform this task easier:
>
> 1. Find all folders named Archive in a volume.
> 2. Of all the folders founds, find all files within those folders that are
> 60 days old.
> 3. Delete the 60-day old files but preserve the rest of the files and the
> folders.
> 4. File types are not all the same i.e. there are .xml, .log, etc.
>
> Any help is highly appreciated.