Solved

xcopy alters the creation date of destination files copied but not 'copy'

Posted on 2013-10-26
7
360 Views
Last Modified: 2013-10-29
When i used xcopy to copy files from one PC to another PC's
drive (which is mapped by the current PC), the destination
files/folders created will take the date stamp of the date
that this xcopy command is being done.

Windows command prompt's  "copy" command will retain
the date of the original source's files but I have lots of
subdirectories so 'copy' command is not practical.

What other ways I can do to do the subdir copying that
retains the source files/folder's date/time stamp?

if there's no other suggestions, I'll test out Windows Explorer
later
0
Comment
Question by:sunhux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 13

Assisted Solution

by:Daniel Helgenberger
Daniel Helgenberger earned 78 total points
ID: 39602553
Consider using robocopy, MS's try to mimic rsync. Build in, fairly powerful:
robocopy /mir <source> <dest>

Open in new window

http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx
0
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 196 total points
ID: 39602560
+1 for robocopy

Robocopy <source> <destination> /mir /dcopy:t /L

/mir is for mirroring
/dcopt:t preserves timestamps

/L will list the actions so you can verify that it will run correctly.

Remove /L to do the actual copy.
0
 

Author Comment

by:sunhux
ID: 39602875
Thanks, managed to get a copy of Robocopy.


Just one last question:

What if I want Robocopy operation such that if Robocopy
detects that the destination file is newer, it will not over-write
(& not delete) the destination file/folder.  What qualifier to use?
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:sunhux
ID: 39602881
And one last query:
does /mir  only do the 'differential' copy ie if the
destination has a file of the same date, it will not
copy/overwrite.  In this way copying of the tens of
thousands of files can be completed faster
0
 
LVL 28

Assisted Solution

by:Bill Bach
Bill Bach earned 116 total points
ID: 39602915
I agree that RoboCopy is likely one of the best options.  However, sometimes you want to be able to "see" what is going on, or to have more specific control over the process.  Check out the Beyond Compare utility (www.beyondcompare.com) and see if it works for you.  It supports command-line execution, handles mirroring very easily, is SUPER-FAST, and (unlike RoboCopy) has a complete GUI interface that you can use, too.  

This GUI makes it a lot easier to see exactly what will be copied (and what won't).  Personally, I found this tool years ago and continue to use this tool for my development folders.  When I develop on one machine and need to transfer back to the server (or to my laptop when traveling), I can bring up both directory lists side-by-side, sync data in one direcvtion (or both), and know that I have full control over the process because I tell it which files to copy from the GUI interface.  

Of course, I also use the same tool for automated backups -- scheduling the command-line script on a Windows server and running it every day to back up critical data to a NAS and then later to an external USB HDD.
0
 
LVL 18

Accepted Solution

by:
Steven Harris earned 196 total points
ID: 39603060
@ sunhux

Thanks, managed to get a copy of Robocopy.

ROBOCOPY is a command line tool, no download needed...

Just one last question:
What if I want Robocopy operation such that if Robocopy
detects that the destination file is newer, it will not over-write
(& not delete) the destination file/folder.  What qualifier to use?

you are looking for the /XO syntax.

/XO - if destination file exists and is the same date or newer than the source - don’t bother to overwrite it.

Visit SS64.com for a full listing of ROBOCOPY commands.  There are so many variations you can create, the possibilities are almost endless.

ROBOCOPY
0
 
LVL 28

Assisted Solution

by:Bill Bach
Bill Bach earned 116 total points
ID: 39603390
Not germaine to the thread -- but Robocopy is only included as part of Vista and 2008 Server (and newer).  Users of Windows XP and Server 2003 would need to go out & find a download.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question