Solved

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

Posted on 2013-10-26
7
368 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
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

624 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