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: Need xcopy script help

20 Apr 2011   #1

Windows 7 Ent 32 bit
 
 
Need xcopy script help

I'm looking for a script that will allow me to copy and "overwrite" all files with a date and time stamp BEFORE a certain date. The source files will NOT be deleted and all permissions will stay the same in destination directories. Copy does include subfolders as well. Any ideas?

My System SpecsSystem Spec
.

20 Apr 2011   #2

Windows 7 Home Pre
 
 

Robocopy - Wikipedia, the free encyclopedia

I think this is what your looking for.
My System SpecsSystem Spec
20 Apr 2011   #3

Windows 7 Ent 32 bit
 
 

Thanks, but I don't believe robocopy will "overwrite" files with the same date and time stamp. I will be copying identical files and need to overwrite those files. The issue however is that I only want to overwrite files with a date and time stamp before 4/16/2011. From what I understand, xcopy will actually overwrite the files.
My System SpecsSystem Spec
.


20 Apr 2011   #4

Windows 7 Home Pre
 
 

Then in that case, MS-DOS xcopy command help and learn it. Its simple to do a batch code in txt doc and change too .bat and run it.
My System SpecsSystem Spec
20 Apr 2011   #5

XP / Win7 x64 Pro
 
 

Why don't you just sort the files by time and only copy over/overwrite the ones over that are prior to the particular date and time?
My System SpecsSystem Spec
20 Apr 2011   #6

Microsoft Community Contributor Award Recipient

Vista x64 / 7 X64
 
 

Copy files changed on or after the specified date:

xcopy Source [Destination] [/d[:mm-dd-yyyy]]

Copy only files with date/time more recent than destination date/time:

xcopy Source [Destination] /D

/R overwite read only

/Y don't prompt for overwrite
My System SpecsSystem Spec
20 Apr 2011   #7

XP / Win7 x64 Pro
 
 

This should work for you:

Code:
robocopy /COPYALL /IS /MINAGE:20110415
/COPYALL : Copy ALL file info (equivalent to /COPYATSOU).
/MINAGE:n : MINimum file AGE - exclude files newer than n days/date.
(If n < 1900 then n = no of days, else n = YYYYMMDD date).
/IS : Include Same, overwrite files even if they are already the same.
My System SpecsSystem Spec
20 Apr 2011   #8

XP / Win7 x64 Pro
 
 

Quote   Quote: Originally Posted by SIW2 View Post
Copy files changed on or after the specified date:

xcopy Source [Destination] [/d[:mm-dd-yyyy]]

Copy only files with date/time more recent than destination date/time:

xcopy Source [Destination] /D
The first is only checking dates and times of the source file and it sounds like he want to replace based on destination date/time.

The second only checks the source date/time against the destination date/time and not a specified date/time, should this be different.
My System SpecsSystem Spec
Reply

 Need xcopy script help





Thread Tools



Similar help and support threads for2: Need xcopy script help
Thread Forum
Solved xcopy comes up with 'file not found' General Discussion
Xcopy cannot create directory General Discussion
I Need Help To Reorder The Context Menu Script In Script Form? Customization
Help with bat file (xcopy) on Win7 General Discussion
VBS script: Cannot find script engine General Discussion
script error when running a vbs script. Network & Sharing
Just an FYI on RoboCopy and Xcopy Software

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 08:54 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33