View Complete Thread
  • Re: issues with FileSystemObject and date properties on win server 2016 / IIS 10

    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")
    response.write folder2.Path&"<br>"
    response.write folder2.DateLastModified&"<br>"
    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:

    13/09/2018 16:27:03
    03/07/2019 19:26:58

    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\:

    13/09/2018 16:27:03
    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 ?