retaining dates on files and folders

G

Guest

Is there a setting in Windows that will tell the system to retain the
original date of files and folders when they are copied?
We get files from overseas and they go through several systems each time
being copied. We need to know the original date that the file was created. by
the time we get them the date and time is today not the date and time the
files were created.
So we have to discover the date and time and then manually set that date
into our program.

At one time I was told that if the ARCHIVE attribute was set to A then the
file would retain the original date and time. But that does not seem to work
anymore.
I was told that ROBOCOPY from the Windows resource kit would do this but it
is a command line product and I really do not want that.

Any suggestions? Thanks
 
G

Guest

This must be such a stupid question that no one will give me a hint as to how
to solve it.
thanks
 
D

Don Taylor

=?Utf-8?B?UmF5?= said:
This must be such a stupid question that no one will give me a hint as to how
to solve it.

Not a stupid question at all, in fact I'm somewhat surprised that
Windows users don't find great glee in accomplishing this via

<left ctrl><right alt><left and right shift><middle click using your nose><and then drag>

One possible solution:
If you grab a little collection of unix-look-alike tools that will
run under Windows just fine then I believe the cp command has an
option to do exactly this.

My more than decade old ancient MKS Toolkit uses -m to do this

cp -m file1 file2

will copy file1 to file2 and will retain the timestamp of file1
on file2, that is what the -m option does.

For POSIX compatibility, which is newer than what I use, this

http://www.icewalkers.com/Linux/ManPages/cp-1.html

says that POSIX uses -p option to preserve not only timestamp
but permissions AND all the other attributes of the file. But
I learned BSD decades ago haven't made the switch to POSIX.

And you can find a cp that will work under Windows without a
lot of trouble.

Or as others suggested, the sledgehammer approach of archiving
and unarchiving the file just to subvert the timestamp change.

Reminds me of the time a few decades ago where some kid found he
could copy his file to Norway to run through a file converter and
get back the modified file. People were not amused at the
bandwidth he was using, back when the net was far smaller and
bandwidth still seemed to matter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top