PowerBasic Museum 2020-A

Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Windows Script Runtime => Source Code => Scripting => FileSystemObject => Topic started by: José Roca on July 14, 2008, 01:57:29 AM

Title: IFolder.DateLastCreated Property
Post by: José Roca on July 14, 2008, 01:57:29 AM


The following code illustrates the use of the DateLastAccessed property with a folder:


#INCLUDE "windows.inc"
#INCLUDE "scrrun.inc"

DIM fso AS IFileSystem
DIM pFolder AS IFolder
DIM dDateLastAccessed AS DOUBLE

' Create an instance of the FileSystemObject
fso = NEWCOM "Scripting.FileSystemObject"
' Get a reference to the IFile interface
pFolder = fso.GetFolder(UCODE$("C:\MyFolder"))
' Get the date in which the folder was last accessed
dDateLastAccessed = pFolder.DateLastAccessed
' Convert the date to a formated string
DIM d  AS ASCIIZ * 64
DIM st AS SYSTEMTIME
VariantTimeToSystemTime dDateLastAccessed, st
GetDateFormat %LOCALE_USER_DEFAULT, %DATE_SHORTDATE, st, BYVAL %NULL, d, 64 d, 64
MSGBOX "Date: " & d