VBS to delete subfolders in folders

March 28, 2009 at 09:55:26
Specs: Windows XP
I am new to VBS and was wondering how you would write a script that would delete subfolders of subfolders found in a directory.... the delete would need to be by part of the name as well as the date created.

so... as an example....

folder A contains folder B
folder B contains folder C

search folder A.... and within any folders in folder A ( in this case B ), search those folders for folders ( in this case C ). If the folders found contain folder C and C is older than 30 days.... delete that folder and all of it's contents....

Thanks for any help in advance....

See More: VBS to delete subfolders in folders

Report •

March 30, 2009 at 01:55:58
i was thinking something like:

for each f in fso.getfolder(pathname).subfolders
if f.datecreated is older than 30 days then

put it inside a function, and then recursively call it.
try it, if you stuck somewhere, post your code here.

Report •
Related Solutions

Ask Question