alter directory modification date 
Author Message
 alter directory modification date

Hi,
   Does anybody know how to change a directory's modification date?
Here is the code(partial) for modifying a file.  Is it just matter of
obtaining a handle for directory instead of a file?  If so, how do I get
the handle for a directory.

Private Sub changetime()
     Dim hFile As Long
     Dim fName As String
     Dim tmp As String
     Dim OFS As OFSTRUCT
     Dim SYS_TIME As SYSTEMTIME
     Dim FT_CREATE As FILETIME
     Dim FT_ACCESS As FILETIME
     Dim FT_WRITE As FILETIME
     Dim NEW_TIME As FILETIME

     fName = (txtFileName)

     hFile = OpenFile(fName, OFS, OF_READWRITE)
     MsgBox OFS.nErrCode

     If hFile Then

        GetSystemTime SYS_TIME
        Call SystemTimeToFileTime(SYS_TIME, NEW_TIME)
        Call SetFileTime(hFile, NEW_TIME, NEW_TIME, NEW_TIME)

     End If

     Call CloseHandle(hFile)
End Sub

-
Phil

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 09 Apr 2003 03:00:00 GMT  
 alter directory modification date
You need to use

hFile = CreateFile(...)

works under NT but not Win95

On Sat, 21 Oct 2000 18:23:47 GMT, Phil Hillerman

Quote:

>Hi,
>   Does anybody know how to change a directory's modification date?
>Here is the code(partial) for modifying a file.  Is it just matter of
>obtaining a handle for directory instead of a file?  If so, how do I get
>the handle for a directory.

>Private Sub changetime()
>     Dim hFile As Long
>     Dim fName As String
>     Dim tmp As String
>     Dim OFS As OFSTRUCT
>     Dim SYS_TIME As SYSTEMTIME
>     Dim FT_CREATE As FILETIME
>     Dim FT_ACCESS As FILETIME
>     Dim FT_WRITE As FILETIME
>     Dim NEW_TIME As FILETIME

>     fName = (txtFileName)

>     hFile = OpenFile(fName, OFS, OF_READWRITE)
>     MsgBox OFS.nErrCode

>     If hFile Then

>        GetSystemTime SYS_TIME
>        Call SystemTimeToFileTime(SYS_TIME, NEW_TIME)
>        Call SetFileTime(hFile, NEW_TIME, NEW_TIME, NEW_TIME)

>     End If

>     Call CloseHandle(hFile)
>End Sub

>-
>Phil

>Sent via Deja.com http://www.deja.com/
>Before you buy.



Sun, 13 Apr 2003 08:16:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. alter directory modification date

2. Visual Basic 2008 and Active Directory computer description modifications

3. Record modification date information?

4. Modification to Time and Date stamp needed

5. Halp - Modification date

6. Custom Form Date Modification Error.

7. File Modification Date/Time - grabbing and setting

8. Modification date of a file

9. Date/time of last modification for an URL

10. Altering File Date and Time

11. VB - Altering File Date and Times

12. Altering dates

 

 
Powered by phpBB® Forum Software