Change Create/Modified Date? 
Author Message
 Change Create/Modified Date?

How do you go about changing the created or modified date of a file?

I have about 16,000 HTML docs that I'd like to change the created date
based on a date string in the document itself. For instance, I would
search the document for the string "Created on:", then take the value
after that string and plug into a script that will modify the Create
Date for the doc. This is for use in a search engine on a CD-ROM, so
that the search results show the correct date.

I have several formats to work with (i.e. "May 21,1999 at 19:23" or
"02/01/2000 - 9:32PM"), so I'll have to do them in groups based on the
date format.

I have some experience with LotusScript (no flames please), which is
basically the same language. But I'm not even sure where or how to run
the VB.

Is this even possible?

I've seen plenty of shareware programs that will let you change the file
dates, but no raw code that will let me cusomize it. Thanks.



Sun, 24 Aug 2003 01:15:14 GMT  
 Change Create/Modified Date?
Mark,

Check out the "Error Handling" thread posted on 2/21/2001. Michael Harris
added a nice way to re-stamp a modified date on files for a script I made.
(included in that thread).

Cheers,
Chris


Quote:
> How do you go about changing the created or modified date of a file?

> I have about 16,000 HTML docs that I'd like to change the created date
> based on a date string in the document itself. For instance, I would
> search the document for the string "Created on:", then take the value
> after that string and plug into a script that will modify the Create
> Date for the doc. This is for use in a search engine on a CD-ROM, so
> that the search results show the correct date.

> I have several formats to work with (i.e. "May 21,1999 at 19:23" or
> "02/01/2000 - 9:32PM"), so I'll have to do them in groups based on the
> date format.

> I have some experience with LotusScript (no flames please), which is
> basically the same language. But I'm not even sure where or how to run
> the VB.

> Is this even possible?

> I've seen plenty of shareware programs that will let you change the file
> dates, but no raw code that will let me cusomize it. Thanks.



Sun, 24 Aug 2003 04:06:52 GMT  
 Change Create/Modified Date?
Okay, nevermind. It doesn't appear to actually re-stamp the file, just
change the variable.


Sun, 24 Aug 2003 04:28:59 GMT  
 Change Create/Modified Date?
There isn't any script-only way (that I know of) to write a utility like this.  You *can* do this
with the Win32 SetFileTime API call, so I guess I'd suggest writing your own COM wrapper.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> Mark,

> Check out the "Error Handling" thread posted on 2/21/2001. Michael Harris
> added a nice way to re-stamp a modified date on files for a script I made.
> (included in that thread).

> Cheers,
> Chris



> > How do you go about changing the created or modified date of a file?

> > I have about 16,000 HTML docs that I'd like to change the created date
> > based on a date string in the document itself. For instance, I would
> > search the document for the string "Created on:", then take the value
> > after that string and plug into a script that will modify the Create
> > Date for the doc. This is for use in a search engine on a CD-ROM, so
> > that the search results show the correct date.

> > I have several formats to work with (i.e. "May 21,1999 at 19:23" or
> > "02/01/2000 - 9:32PM"), so I'll have to do them in groups based on the
> > date format.

> > I have some experience with LotusScript (no flames please), which is
> > basically the same language. But I'm not even sure where or how to run
> > the VB.

> > Is this even possible?

> > I've seen plenty of shareware programs that will let you change the file
> > dates, but no raw code that will let me cusomize it. Thanks.



Sun, 24 Aug 2003 12:05:30 GMT  
 Change Create/Modified Date?

Quote:

> The DOS Copy command will allow you to change a file's creation date. Say
> that you have a file called c:\test.txt and you want to change the creation
> date to December 1, 1999. You would issue the following commands at the
> command prompt.

> date 12/1/1999
> copy/b/y c:\test.txt+,,

> It should be fairly easy to process your HTML files using the FSO, extract
> the date string out and do something like the above by using WScript.Shell
> to run the Date and Copy commands, which by the way are internal commands
> which have to run via %comspec%. Just be sure to change the date back
> afterwards to avoid strange problems with your apps and to never run the
> procedure while other date-sensitive apps are running.

Thanks to all who responded. It sounds like this may be the simplest option.
I'll give it a try.

Mark Darrah



Mon, 25 Aug 2003 11:30:12 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Change the Last Modify and Last Access date

2. Change File Modified Date

3. Changing 'Modified' date of e-mails

4. VS.NET 2003 - Date Modified Never Changes!?

5. Modifying Create Date

6. mod created, modified time/date attribs on files?

7. HELP: File Properties - Create, Modified, Accessed Dates.

8. VB5: Date File Created/Modified ?

9. Modifying the Last Modified Date and Time

10. Changing created/modified/accessed properties of a file

11. data's modified date as update's date

12. Change a file Date Created property ?

 

 
Powered by phpBB® Forum Software