Using Folder Properties

Microsoft® Windows® 2000 Scripting Guide

Because folders are COM objects, they have properties that can be retrieved and enumerated. To retrieve detailed information about a specified folder, you can use the Folder object, one of the components of the FileSystemObject. The properties of the Folder object are listed in Table 4.3.

Table 4.3 Folder Properties

Property

Description

Attributes

Bitmap containing the attributes for the folder. For more information, see "Managing Folder Attributes" later in this chapter.

DateCreated

Date that the folder was created.

DateLastAccessed

Date of the last time a user accessed the contents of the folder.

DateLastModified

Date of the last time a user modified the properties of the folder.

Drive

Drive letter and trailing colon (for example, C:) representing the drive on which the folder is stored.

Files

Collection containing a file object for each file stored in the folder.

IsRootFolder

Boolean value indicating whether the folder is a root folder (such as C:\).

Name

Folder name, not including path information. For example, the Name of the folder C:\Windows\System32 is System32.

ParentFolder

Name of the folder in which this folder is stored. For example, the ParentFolder of C:\Windows\System32 is Windows; the ParentFolder of C:\Scripts is C:\.

Path

Full path of the folder (for example, C:\Windows\System32).

ShortName

MS-DOS®-style name of the folder, using the 8.3 naming convention. For example, the folder C:\Windows\Program Files might have the ShortName Progra~1.

ShortPath

MS-DOS-style path to the folder, using the 8.3 naming convention. For example, the folder C:\Windows\Program Files might have the ShortName C:\Windows\Progra~1.

Size

Total size, in bytes, of the contents of the folder. This includes the files stored within the folder as well as all the files stored within any subfolders of the folder.

SubFolders

Collection of all the top-level subfolders contained within this folder. Subfolders contained within these subfolders are not included in the collection.

Type

String describing the folder type. This is almost always "File Folder".