Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Move files older than 365 days

30 Oct 2012   #1
CBHV

windows 7 64bit
 
 
Move files older than 365 days

I have a set of files I would like to archive and thing older than 1 year or 365 days. I have been trying to to use the xcopy or move commands but have not been able to to get this to work. Anyone have any thoughts on how to do this in a batch file? Thanks.


My System SpecsSystem Spec
.
31 Oct 2012   #2
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Hi,

Try ROBOCOPY. Type robocopy /? at the command prompt to see the options. You are probably interested in the /MOVE AND /MAXAGE:n switches.

Example:
Code:
robocopy E:\DataFiles Z:\Backup\DataFiles /MOVE /MAXAGE:365
Moves all files in E:\DataFiles that are older than 365 days into Z:\Backup\DataFiles. robocopy commands can be incorporated into batch files just like copy or xcopy.

Regards,
Golden
My System SpecsSystem Spec
31 Oct 2012   #3
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by CBHV View Post
I have a set of files I would like to archive and thing older than 1 year or 365 days. I have been trying to to use the xcopy or move commands but have not been able to to get this to work. Anyone have any thoughts on how to do this in a batch file? Thanks.
With older than 365 days you mean "not modified last 365 days" or "not created last 365 days"? If you mean "not modified last 365 days" ... do what user Golden told you
My System SpecsSystem Spec
.

31 Oct 2012   #4
CBHV

windows 7 64bit
 
 

That did it had did not know about maxage. Thanks for help Golden.

Quote   Quote: Originally Posted by Golden View Post
Hi,

Try ROBOCOPY. Type robocopy /? at the command prompt to see the options. You are probably interested in the /MOVE AND /MAXAGE:n switches.

Example:
Code:
robocopy E:\DataFiles Z:\Backup\DataFiles /MOVE /MAXAGE:365
Moves all files in E:\DataFiles that are older than 365 days into Z:\Backup\DataFiles. robocopy commands can be incorporated into batch files just like copy or xcopy.

Regards,
Golden
My System SpecsSystem Spec
31 Oct 2012   #5
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

My System SpecsSystem Spec
01 Jan 2016   #6
SaxxyLady

Windows 7 Home 64-bit
 
 

I'm going to disagree with using the switch /maxage. If you want to move files older than 365 days, then the switch should be /minage as you want the move to only occur for files older than 365 days. I just tried myself and maxage actually moving files newer than 365 days from today.
My System SpecsSystem Spec
01 Jan 2016   #7
mitchell65

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Did you not realise that this thread is over three years old?
My System SpecsSystem Spec
01 Jan 2016   #8
sunk818

CALIFORNIA
 
 

Is there a rule against replying to old threads? The answer is wrong and seems more useful to correct it than to point out the thread is three years old.
My System SpecsSystem Spec
02 Jan 2016   #9
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Sigh..................have a look at robocopy /? at the command line.

Code:
 /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.
 /MINAGE:n :: MINimum file AGE - exclude files newer than n days/date.
Read post #4 to se whether the solution worked for the original poster.
My System SpecsSystem Spec
02 Jan 2016   #10
sunk818

CALIFORNIA
 
 

Either the op miswrote their question or didn't actually try the solution. He just thanked you for your post but doesn't actually confirm your solution is correct.

If you use maxage switch, it will exclude files that are older than one year. This means only files newer than one year get moved. That's exactly the opposite of what op wants.

Try the solution yourself and you will see maxage is the wrong switch for what the op is asking for (unless the op wanted something different from what s/he posted).
My System SpecsSystem Spec
Reply

 Move files older than 365 days




Thread Tools




Similar help and support threads
Thread Forum
Should I move to win 7 with my older computer
On my other computer it is currently running Vista and is very unstable. This is partly because it only has 1GB of ram and I cannot afford to upgrade it at the moment and I was wondering whether anyone could tell me if they think that Windows 7 would run better on this amount of RAM as I seem to...
General Discussion
.reg files open Notepad - do not change registry to read older files
Running Win7Pro 64-bit. Am unable to open older Office 97 files with Office2003 which is installed and running fine. I found a couple of files here and elsewhere with .reg extensions that were supposed to make the necessary registry changes. eg. "UnlockWord.reg" and a more elaborate-looking...
Microsoft Office
Can't move folders with files, but can move files
I am attempting to move folders and files around, doing a little organization on my HDD. However if I attempt to move the loaded folder I get the error message " The action can't be completed because the folder or a file in it is open in another program." However I have no other programs open,...
General Discussion
Move Program FIles to SSD - Leave Users files Behind
Greetings Again, My file and storage system is set up like this: C:\ Drive - 120 GB SSD This is my Win 7 64-Bit Ultimate Boot drive. It has my most important Microsoft programs on it. Out of the 111GB available, I've used 42GB, leaving me 69GB free space. I want to keep this area open. ...
General Discussion
Help with choppy sound from older wav files?
Hello all I recently installed a full version of Win7 and much like I have alwasy done, I copied over the themes files from my old "Windows 95 Plus!" program I have to which I use a group of the "Nature" sound files for all my OS activation sounds. For the most part most are OK as they always...
Sound & Audio


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:40.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App