lcfile = GETFILE("*") >>>>IF NOT EMPTY(lcfile) >>>> oFSO = CREATEOBJECT("Scripting.FileSystemObject") >>>> CREATE CURSOR filesFSO (Path M, FileName M, Size I, Created T, Modified T) >>>> oFile = oFSO.GetFile(lcfile) >>>> WITH oFile >>>> INSERT INTO filesFSO (Path, Filename, Size, Created, Modified); >>>> VALUES (.Path, .Name, .Size, .DateCreated, .DateLastModified) >>>> ENDWITH >>>>ENDIF>>>
FUNCTION RecurseFolderFSO >>>LPARAMETER toFolderObject >>>WITH toFolderObject >>> FOR EACH oFile IN .Files >>> WITH oFile >>> INSERT INTO filesFSO (Path, Filename, Size, Created, Modified); >>> VALUES (.Path, .Name, .Size, .DateCreated, .DateLastModified) >>> ENDWITH >>> ENDFOR >>> FOR EACH oSubFolder in .SubFolders >>> RecurseFolderFSO(oSubFolder) >>> ENDFOR >>>ENDWITH >>>Robert,
lcdir = GETDIR() && Selected the Windows\System folder >>oDir = oFSO.GetFolder(lcdir) >>? oDir.DateCreated && COM error 0x800a0005The workaround is that
? TYPE('oDir.DateCreated')returns "U". If it's "T", then you can access the property.
WITH oFolder INSERT INTO filesFSO (Path, Filename, Size, Created, Modified); VALUES (.Path, .Name, .Size, IIF(TYPE('oFolder.DateCreated') # 'U' ,.DateCreated, DATE(1900, 1, 1)), .DateLastModified) ENDWITHIt's a minimal change, and would probably require that some other code would have to be modified to recognize the date chosen to represent the fact that the real date couldn't be pulled.