Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I asked this on stackoverflow... but I think I should be asking it here: Is it possible to copy a file or a folder from one location to another without modifying its attribute data?

For example if I have a folder on a network drive and it was created on 2/3/2007 and I want to copy it to my c: drive .. but leave the date/time stamp as 2/3/2007...is that possible?

share|improve this question

4 Answers 4

Robocopy. Has options to copy various attributes including timestamps

http://www.ss64.com/nt/robocopy.html

Syntax
      ROBOCOPY source_folder destination_folder [file(s)_to_copy] [options]

Key
   file(s)_to_copy : A list of files or a wildcard.
                          (defaults to copying *.*)

  Source options
                /S : Copy Subfolders
                /E : Copy Subfolders, including Empty Subfolders.
 /COPY:copyflag[s] : What to COPY (default is /COPY:DAT).
                      (copyflags : D=Data, A=Attributes, T=Timestamps).
                      (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
              /SEC : Copy files with SECurity (equivalent to /COPY:DATS).
          /DCOPY:T : Copy Directory Timestamps. ##
          /COPYALL : Copy ALL file info (equivalent to /COPY:DATSOU).
           /NOCOPY : Copy NO file info (useful with /PURGE)
share|improve this answer

rsync has the option "-t, --times" to preserve times.

share|improve this answer

Seeing as this was also tagged with C#:

You can copy a file and any attributes/timestamps you like along with it:

File.Copy(myFile, myNewFile);
File.SetCreationTime(myNewFile, File.GetCreationTime(myFile));
share|improve this answer

You can use Total Commander (ghishler). In setup utilities, copy, you can set copying folders to copy date and time. It works copying folder for c: to e: but copying for e: to desktop i had a problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.