The following code illustrates the use of the
DateCreated property with a file:
JScript
function ShowFileInfo(filespec)
{
var fso, f, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFile(filespec);
s = "Created: " + f.DateCreated;
return(s);
}
VBScript
Function ShowFileInfo(filespec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filespec)
ShowFileInfo = "Created: " & f.DateCreated
End Function
PowerBASIC
FUNCTION ShowFileInfo (BYVAL filespec AS STRING) AS STRING
LOCAL fso AS IFileSystem
LOCAL f AS IFile
fso = NEWCOM "Scripting.FileSystemObject")
f = fso.GetFile(UCODE$(filespec))
FUNCTION = "Created: " & PB_VariantDateToString(f.DateCreated)
END FUNCTION