How do I reset a file date?

J

John Brock

I recently converted a large number of documents from one format
to another, but unfortunately the conversion utility would not
preserve the files dates. Is there Windows command (NT or XP)
which will reset the date on a file to match the date of another
file (like 'touch' in Unix)? If not in Windows itself then perhaps
in one of the Resource Kits?

If there is no native Windows command that will do this then what
third-party utility would you recommend? It has to work from the
command line, because I want to write a script to set the timestamps
on the converted files based on the corresponding unconverted files.
 
P

Pegasus \(MVP\)

John Brock said:
I recently converted a large number of documents from one format
to another, but unfortunately the conversion utility would not
preserve the files dates. Is there Windows command (NT or XP)
which will reset the date on a file to match the date of another
file (like 'touch' in Unix)? If not in Windows itself then perhaps
in one of the Resource Kits?

If there is no native Windows command that will do this then what
third-party utility would you recommend? It has to work from the
command line, because I want to write a script to set the timestamps
on the converted files based on the corresponding unconverted files.

Check Google for one of the countless free versions of touch.exe
for Windows. Most are command line driven.
 
M

MGGP

Well . . . you could change the date and time on your
computer, edit the file, change nothing and save it . . .

Good Luck !
 
D

David Candy

copy filename.ext+,,

Touches the modified date to NOW.

Change clock then

cmd /c copy c:\boot.ini+,,

Change clock back.
 
C

Crusty \(-: Old B@stard :-\)

My file manager program will allow me to change all the file attributes,
including the date and time. I can also change the files in all the sub
directories at the same time. Real quick!

--
Regards:

Richard Urban

aka Crusty (-: Old B@stard :)
 
J

John Brock

Check Google for one of the countless free versions of touch.exe
for Windows. Most are command line driven.

Thanks. Actually though it occurs to me now that the easiest thing
for me to do would be to just zip up the entire directory tree,
move the whole thing to a Unix system, run a script there that uses
the Unix 'touch' command, and then copy everything back the same
way. It's a little awkward, but it's a one time deal anyway so
that doesn't matter much.
 
P

Pegasus \(MVP\)

John Brock said:
Thanks. Actually though it occurs to me now that the easiest thing
for me to do would be to just zip up the entire directory tree,
move the whole thing to a Unix system, run a script there that uses
the Unix 'touch' command, and then copy everything back the same
way. It's a little awkward, but it's a one time deal anyway so
that doesn't matter much.

I disagree. Touching files is something that needs to be done
time and again. To me, touch.exe is part of my standard tool
kit. But then everybody has his own preferences.
 

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