How to copy or move files and folders whilst maintaining their original time date stamp.

General

It’s often useful when try to replicate live file data to maintain the date/time stamp of the data you are copying or moving.  As you no doubt know a standard copy whether it be from the command line or by a simple drag and drop will give any copied/moved files a new date/time stamp of the current time.

A simple way of maintaining the original date/time stamp of a file or folder is by using the ever useful  Microsoft RoboCopy utility.  This is built into Windows Server 2008, Vista and Windows 7 as standard though if you are running an earlier Windows OS (eg: XP or Windows Server 2003) it can be found, and used, as part of the Windows Server 2003 Resource Toolkit which can be downloaded from here. 

However I should point out that the useful ‘DCOPY’ command which maintains the date/timestamp of the directories is only available with the versions of Robocopy found after that in the Windows Server 2003 Resource Toolkit (ie: > XP010).

For the ‘DCOPY’ command you will require the XP026 version of Robocopy which can only be found in a Microsoft Utility called ‘Utility Spotlight’ which provides a GUI front-end to Robocopy and can be downloaded via a link at the top of this page.  Don’t worry as you don’t have to use the GUI interface.

Also if you’re running Windows Server 2003 then you’ll find that the Vista and Windows Server 2008 versions won’t run if you copy and then attempt to run this version of robocopy.exe locally.

If you’ve already downloaded and installed the Windows Server 2003 Resource ToolKit and then Utility Spotlight (GUI Robocopy) you will find that you’ll still get the XP010 version of Robocopy when running it from the command-line.

The reason?  The Utility Spotlight installation copies the updated (ie: XP026) version of Robocopy to the C:\Windows\System32 directory as opposed to the version found in the ‘Resource Toolkit’ directory on the C drive.  When Robocopy is run from the command-line it uses the version (ie: XP010) found in the ‘Resource Toolkit’ directory.

To resolve…  delete the version of Robocopy found in the ‘Resource Toolkit’ found on the C drive.  When you go to run Robocopy from the command-line again it’ll use the more recent version found in C:\Windows\System32.

Here is a summary of the different versions:

  • XP010 – Bundled in the Windows 2003 resource kit
  • XP026 – Downloaded with Robocopy GUI
  • XP027 – Bundled with Windows Vista
  • XP028 – Bundled with Windows Vista SP1 and Windows Server 2008

Below is an example of the Robocopy syntax that you’d use to maintain the date/time stamp on both the files and directories during a copy:

How to copy or move files and folders whilst maintaining their original time date stamp

For a good explanation of all the Robocopy commands checkout this Wikipedia entry.

 

Related posts:

  1. Windows Fast File Copy (Free) Utility Here’s a link to a great free Windows file...
  2. Microsoft Windows 7 – August 2009 Launch Date? It looks like the cat has been let out...
  3. What ever happened to ‘winmsd’ in Windows Server 2008, Vista and Windows 7? Something that caught me out recently was trying to...
  4. How to create a bootable VMware ESXi 3.5 & 4.0 (vSphere) USB pen drive. There are a couple of methods to create a...
  5. April 21st VMware vSphere Release Date? *** UPDATE 21st April 2009 *** As expected VMware...

You can leave a response, or trackback from your own site.

One Response to “How to copy or move files and folders whilst maintaining their original time date stamp.”

  1. octavius says:

    WOW!! This is great. It makes a real difference when doing large file copies. Cheers!

    [Reply]

Leave a Reply

You can add images to your comment by clicking here.

Virtu-Al.net
PHD Virtual - esXpress
Veeam - Backup & Replication
Virtualization Pro Summit 2010
StarWind Software
TrainSignal - vSphere Pro