1

I like to move files accessed for a long time. For instance: if I do not access some file by 7 days, it move to old sub-folder.

file1.txt    1 days         <keep>
file2.txt    2 days         <keep>
file3.txt    4 days         <keep>
file4.txt    7 days         <move to old>
file5.txt    10 days        <move to old>
1

2 Answers 2

1

I would use the following Robocopy syntax

ROBOCOPY "C:\MyFiles" "C:\OldFiles" /move /minage:30 /s

In the above note minage:30

This will move everything older than 30 days

So, in your instance, you'll use

minage:7

ROBOCOPY "C:\MyFiles" "C:\OldFiles" /move /minage:7 /s

Your post isn't clear if you only want this to be targetting .txt files or not, if so then use

ROBOCOPY "C:\MyFiles\*.txt" "C:\OldFiles" /move /minage:7 /s

Then, you simply set this up to run every day from Task Scheduler.

0

Try Robocopy. More precisely the following command should help. It is merely a template :). The command only moves all text files from "source" to "old" older than last week (03/23/2015)

ROBOCOPY C:\source\*.txt C:\old /MOVE /MINAGE:n = 20150323
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .