Home All Groups Group Topic Archive Search About

Change the date modified

Author
20 Jan 2006 5:27 AM
Cornjerker
I see where I can change the date a file is created....

File.SetCreationTime(path)

But how can I change the date a file is modified.

Thanks, C

Author
20 Jan 2006 8:23 AM
Peter Proost
Hi

File.SetLastWriteTime(path,date)

Hth,

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

Show quoteHide quote
"Cornjerker" <add***@gmail.com> schreef in bericht
news:1137734827.505075.14150@z14g2000cwz.googlegroups.com...
> I see where I can change the date a file is created....
>
> File.SetCreationTime(path)
>
> But how can I change the date a file is modified.
>
> Thanks, C
>
Author
21 Jan 2006 3:13 PM
Cornjerker
Thanks for the reply, but this didn't change the "Date Modified" in the
windows explorer.  I'll just use the date created instead.

C
Author
23 Jan 2006 8:37 AM
Peter Proost
Did you try it like this?

System.IO.File.SetLastWriteTime("c:\test.txt", New Date(2099, 5, 5))

because this should do the trick.

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)


Show quoteHide quote
"Cornjerker" <add***@gmail.com> schreef in bericht
news:1137856397.567937.261750@g14g2000cwa.googlegroups.com...
> Thanks for the reply, but this didn't change the "Date Modified" in the
> windows explorer.  I'll just use the date created instead.
>
> C
>