ShortName 屬性返回按照早期 8.3 檔案命名規範轉換的短檔案名稱。object.ShortName object 應為 File 或 Folder 對象的名稱。說明以下代碼舉例說明如何使用 ShortName 屬性:Function ShowShortName(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f =
ShortPath 屬性返回按照 8.3 命名規範轉換的短路徑名。object.ShortPath object 應為 File 或 Folder 對象的名稱。說明以下代碼舉例說明如何使用 ShortName 屬性:Function ShowShortPath(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile(filespec)
Size 屬性對於檔案,返回指定檔案的位元組數;對於檔案夾,返回該檔案夾中所有檔案和子檔案夾的位元組數。object.Size object 應為 File 或 Folder 對象的名稱。說明以下代碼舉例說明如何使用 Folder 對象的 Size 屬性:Function ShowFolderSize(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.
Name 屬性設定或返回指定的檔案或檔案夾的名稱。可讀寫。object.Name [= newname] 參數object必選項。應為 File 或 Folder 對象的名稱。newname可選項。如果提供此參數,則指定的 object 名稱更新為 newname。說明以下代碼舉例說明如何使用 Name 屬性:Function ShowFileAccessInfo(filespec) Dim fso, f, s Set fso =
DriveType 屬性返回一個描述指定磁碟機的類型的值。object.DriveType object 應為 Drive 對象的名稱。說明以下代碼舉例說明如何使用 DriveType 屬性:Function ShowDriveType(drvpath) Dim fso, d, t Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(drvpath) Select Case
ParentFolder 屬性返回指定檔案或檔案夾的父資料夾。唯讀。object.ParentFolder object 應為 File 或 Folder 對象的名稱。說明以下代碼舉例說明如何使用 ParentFolder 屬性:Function ShowFileAccessInfo(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f =
Type 屬性返迴文件或檔案夾的類型資訊。例如,對於副檔名為 .TXT 的檔案,返回“Text Document”。object.Type object 應為 File 或 Folder 對象的名稱。說明以下代碼舉例說明如何使用 Type 屬性返迴文件夾的類型。在此樣本中,試圖向過程提供“資源回收筒”或其他唯一檔案夾的路徑。 Function ShowFolderType(filespec) Dim fso, f, s Set fso =