Solved

Change directory date & time

Posted on 2000-03-07
8
900 Views
Last Modified: 2013-12-28
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.

Any suggestions?
0
Comment
Question by:plarry
8 Comments
 
LVL 7

Expert Comment

by:sorgie
ID: 2592762
That may be your only alternative.
0
 
LVL 6

Expert Comment

by:1cell
ID: 2592807
0
 
LVL 6

Expert Comment

by:1cell
ID: 2592813
oops, can't verify that it will work for folders but check
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 6

Expert Comment

by:1cell
ID: 2592815
actually, just found that it can but only with NT4
0
 
LVL 1

Expert Comment

by:Azerthur
ID: 2593160
That's easy man !
It 's so simple arf !

Store the system date
Set the system date to the date you want
Create a folder
set the system date to the previous one.


makeit.bat
date dd/mm/yy
md Folder
date previousone ( in fact you won't be able to do it in a batch but you can also make a C++ or Pascal prog)
0
 

Author Comment

by:plarry
ID: 2597661
Thanks to all.  Unfortunately, it looks like W98 doesn't give you the option to change folder dates, or to keep the original folder date when you copy from one area to another.  This strikes me as VERY dumb -- after all, why should files keep their dates but folders lose them? -- but that's where we are.

Azerthur's answer is what I said I could do but didn't want to, in the last paragraph of my question.  I guess I'll take this route, and use APL to drive the process.

....larry
0
 

Accepted Solution

by:
glnsoft earned 100 total points
ID: 2608386
Here ya go.

http://users.intermediatn.net/usamax/

Get this program. It's a evaluation copy but it will work for ya. I have tested and it works great. I have always wanted a program like this but havn't really search the web that much. I finally found one.
0
 

Author Comment

by:plarry
ID: 2616884
That does it.  Thanks.

I wish the interface were more direct and readable, and I found that the software changed my current system date and time, but otherwise it worked as promised.

I think I'll write my own utility to copy all directory/subdirectory dates and times from the source computer to the target computer, just to save the long manual input, but this program works great for changing a few files and directories to different date/time and for changing a lot of files to a single date/time.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now