Rich55555
asked on
Windows Batch Script to Search Network Drive Directorys
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:
p:\abc\letters\reject\
p:\def\letters\printed\
p:\ghi\letters\
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.
Parent directory (p:\*fund*\) could be any directory name, for example:
p:\abc\letters\reject\
p:\def\letters\printed\
p:\ghi\letters\
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER