ParentFolder 屬性描述返回指定檔案或資料夾的父資料夾對象。唯讀。語法object.ParentFolderobject 總是一個 File 或 Folder 對象。說明下面的代碼用一個檔案舉例說明了 ParentFolder 屬性的用法:Sub ShowFileAccessInfo(filespec) Dim fs, f, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(filespec) s = UCase(f.Name) & " in " & UCase(f.ParentFolder) & vbCrLf s = s & "Created: " & f.DateCreated & vbCrLf s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf s = s & "Last Modified: " & f.DateLastModified MsgBox s, 0, "File Access Info"End Sub
"Enclosing Folder"同樣也有“Parent Folder”之意,即表示上級資料夾。