Link to home
Start Free TrialLog in
Avatar of Rich55555
Rich55555Flag for Australia

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.
ASKER CERTIFIED SOLUTION
Avatar of Jonah11
Jonah11

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rich55555

ASKER

Jonah, that gives me something to work with which I wasn't aware existed so thanks for the lead!!!