Windows Batch Script to Search Network Drive Directorys
Posted on 2009-05-12
I need to run a script which will delete files/directorys within a subfolder structure only if certain directorys exist. Then delete the files/directorys which are older that a)7 days.
Parent directory (p:\*fund*\) could be any directory name, for example:
So in above scenario, need to search the root directory (p:\*.*\letters\) for directorys called either reject or printed, then if exist delete the file contents of reject or printed if those files are > than 7 days old.
I've been investigating the CLI in XP and don't think the 'For' or 'If' combined with 'Forfiles' commands can do this. Do I need to look at a more powerful scripting language?
Any help would be apprciated!!
Thanks in advance.