IIS 7 and Above
issues with FileSystemObject and date properties on win server 2016 /...
Re: issues with FileSystemObject and date properties on win server 20...
Jul 04, 2019 09:55 AM|fdumusois|LINK
Thank you for your answer
The example I gave yesterday was not good, now that I read it.
I use getfolder to get a file, it won't work anyway
So I've update the code and it looks to be related to NTFS permissions in a way I don't really understand.
dim ObjFSO, folder1, folder2
set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
set folder1 = ObjFSO.GetFolder("C:\etocomm_appli\sftp\web")
response.write folder1.DateLastModified &"<br>"
set folder2 = ObjFSO.GetFolder("C:\etocomm_appli\sftp")
set folder2 = Nothing
set folder1 = Nothing
set ObjFSO = Nothing
So if I give read rights to IUSR on the parent folder ( C:\etocomm_appli\)I can get the date properties of the child folder (C:\etocomm_appli\sftp)
the result of the code:
If IUSR has no rights ont the parent folder but has still the change rights on the folder itself (C:\etocomm_appli\sftp), I can't get any date properties, and I get the "path not found" error (in french there). The preceding line, where I get the path property,
does not generate an error.
the result of the code with no right for IUSR on C:\etocomm_appli\:
Erreur d'exécution Microsoft VBScript erreur '800a004c'
Chemin d'accès introuvable
/dynamic/ajax/FStree_JSONtest.asp, ligne 9
Isn'it a weird behaviour ? Is it normal to be able to access most of the folder properties, and get a "file not found" error on date properties ? Simply because IUSR has no rights on the parent folder ?