• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

Archive Files / folders for 7 days old

forfiles -p "E:\Test\Daily Report" -s -m *.* -d -7 -c "cmd /c del @path"

How to modify the above command such that

1. it could archive folders (beside files) older than 7 days
2. disable any error message in case it couldn't match the searching criteria

Tks
0
AXISHK
Asked:
AXISHK
1 Solution
 
Kent DyerIT Security Analyst SeniorCommented:
Here are a number of ways to do this task including using a VBS..

http://serverfault.com/questions/49614/delete-files-older-than-x-days

HTH,

Kent
0
 
AXISHKAuthor Commented:
Thanks but can I archive the same purpose with DOS Script ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now