Need xcopy script help


  1. Posts : 2
    Windows 7 Ent 32 bit
       #1

    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 Computer


  2. Posts : 357
    Windows 7 Home Pre
       #2

    Robocopy - Wikipedia, the free encyclopedia

    I think this is what your looking for.
      My Computer


  3. Posts : 2
    Windows 7 Ent 32 bit
    Thread Starter
       #3

    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 Computer


  4. Posts : 357
    Windows 7 Home Pre
       #4

    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 Computer


  5. Posts : 1,814
    XP / Win7 x64 Pro
       #5

    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 Computer


  6. Posts : 16,154
    7 X64
       #6

    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 Computers


  7. Posts : 1,814
    XP / Win7 x64 Pro
       #7

    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 Computer


  8. Posts : 1,814
    XP / Win7 x64 Pro
       #8

    SIW2 said:
    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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:18.
Find Us