?
Solved

How do I change a file's Last Modified Date?

Posted on 2003-03-21
11
Medium Priority
?
243 Views
Last Modified: 2008-03-03
I would like to be able the change to the date and time of a particular file's "last modified" date and timestamp using ASP. Is this possible with the FileSystemObject?

Thanks,
-Greg
0
Comment
Question by:greddin
  • 3
  • 2
  • 2
  • +4
11 Comments
 
LVL 15

Expert Comment

by:gladxml
ID: 8185034
greddin,

Below is the link of whta FSO can do...

http://www.15seconds.com/component/pg000847.htm

I think that it is not possible...

0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8185048
It depends on the file. You might be able to use ASP to open and modify the file, and then as a result, the last modified date would change.

Why would you want to do that?

Fritz the Blank
0
 
LVL 15

Expert Comment

by:gladxml
ID: 8185071
greddin,

BTW why do you want to change the date and time of a particular file's "last modified" date?

Regards,
gladxml
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 15

Expert Comment

by:gladxml
ID: 8185097
greddin,

Related links regarding FSO.

http://www.juicystudio.com/tutorial/asp/files.html#text

As I had said you can only read the modofied time and cannot be edited unless you save the file just like fritz said.

Happy programming...
0
 
LVL 4

Expert Comment

by:Wakie
ID: 8185307
Listening..
0
 
LVL 7

Expert Comment

by:lavinder
ID: 8185319
Hi

 All the above comments by the experts are correct. In ASP, i also think it is not possible only through FSO. But if you really need this functionality, try the code in following link:
http://www.freevbcode.com/ShowCode.Asp?ID=1335
 ...paste it and create an activex dll and call it using asp.
 
 feel free to post your problems in implementation of this.

cheers!!
0
 
LVL 28

Accepted Solution

by:
sybe earned 2000 total points
ID: 8185594
http://www.alphasierrapapa.com/IisDev/Components/AspTouch/

++++++++++++++++
If you are an "old dog" in the computer business, then you definitely remember the touch utilities that were around to give a file a certain date and time stamp - with a common application being setting a common date for all files of a project before it was deployed to a client. Because I didn't save the old utilities in a secure spot, I had to come up with a new solution: a component that does it for me.

The advantage of the component approach is that I can use it in a WSH script to touch multiple files, or use it from within ASP to change the timestamp of certain files. Just in case you wonder what I use it for: I have an online email archive (file based) that is searchable with Index Server, and the date selection is done via the "touched" file date of the messages (the file time is the same as the email time was).

++++++++++++++++
0
 
LVL 34

Expert Comment

by:arbert
ID: 8186809
Are these text files or binary files?  If they are text files, you could use the FSO to alter the date by performing a write to the file.  However, if they are binary, FSO doesn't support binary file writing.....

Brett
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8187053
I was thinking not only FSO--which would be best--but also as a last result, office scripting.

Fritz the Blank
0
 
LVL 34

Expert Comment

by:arbert
ID: 8187065
greddin, if you give us a little better idea of what you're trying to do, we might be able to offer you a better solution.

Brett
0
 

Author Comment

by:greddin
ID: 8187078
Thanks sybe. This works perfect.

-Greg
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses

616 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