|
-
Mar 22nd, 2001, 07:50 AM
#1
Thread Starter
Frenzied Member
I know how to get different dates from files, but is there a way of setting a date / time in a file??
Reading is easy:
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FSOf = FSO.GetFile(fFile)
MsgBox FSOf.datecreated
MsgBox FSOf.datelastmodified
MsgBox FOSf.DateLastAccessed
BUT how do I write into the date:
FSOf.DateCreated = "12/12/2000 12:12:12" ???
Thanks. Chris
-
Mar 22nd, 2001, 07:55 AM
#2
Addicted Member
maybe...?
Code:
x = Date()
y = Time()
Time = *timeyouwant*
Date = *dateyouwant*
'make file...
Time = y
Date = x
hope, it helped.
-
Mar 22nd, 2001, 08:03 AM
#3
Thread Starter
Frenzied Member
Thanks, but thats cheating!
I don't think I will be able to do it that way, as the file might not be on my own PC.... And even if it is, some of my users wont have permission to change the date / time on their (NT) systems.
Chris
-
Mar 22nd, 2001, 08:44 AM
#4
You can set the time & date of a file to whatever you want with the SETFILETIME Api call found at : http://www.vbapi.com/ref/s/setfiletime.html
-
Mar 22nd, 2001, 08:49 AM
#5
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|