Change directory date & time
Posted on 2000-03-07
I want to change the "Modified" date & time that Windows Explorer shows for a particular directory. "SetFileTime" works only for files, not directories.
I copied all directories from an old PC to a new one, and all the directories at every level on the new one now show the date of the transfer rather than the date from the old one -- naturally all the file dates/times are as the original PC had them, it's just the directories whose dates are the new ones.
Reason I want the old directory dates is so that I can sort from newest to oldest in the Explorer window.
I could do this manually and tediously for each directory by moving from current location to another temporary one, changing the date/time on the PC, creating the directory name again in the proper location, and then moving all the sub-files from the temporary location back to the newly named directory. But there are too many directories that this needs to be done for.