ASP Folder Object
The Folder object is used to return information about the specified folder.
Folder Object
The Folder object is used to return information about the specified folder.
To manipulate the properties and methods of the Folder object, you need to create an instance of the Folder object through the FileSystemObject object. First, create a FileSystemObject object, and then instantiate the Folder object using the GetFolder method of the FileSystemObject object.
The following code uses the GetFolder method of the FileSystemObject object to instantiate the Folder object and uses the DateCreated property to return the creation date of the specified folder:
The collections, properties, and methods of the Folder object are described as follows:
Collections
| Collection | Description |
|---|---|
| Files | Returns a collection of all files in the specified folder. |
| SubFolders | Returns a collection of all subfolders in the specified folder. |
Properties
| Property | Description |
|---|---|
| Attributes | Sets or returns the attributes of the specified folder. |
| DateCreated | Returns the date and time the specified folder was created. |
| DateLastAccessed | Returns the date and time the specified folder was last accessed. |
| DateLastModified | Returns the date and time the specified folder was last modified. |
| Drive | Returns the drive letter of the drive on which the specified folder resides. |
| IsRootFolder | Returns true if the folder is the root folder, otherwise returns false. |
| Name | Sets or returns the name of the specified folder. |
| ParentFolder | Returns the parent folder of the specified folder. |
| Path | Returns the path of the specified folder. |
| ShortName | Returns the short name of the specified folder (8.3 naming convention). |
| ShortPath | Returns the short path of the specified folder (8.3 naming convention). |
| Size | Returns the size of the specified folder. |
| Type | Returns the type of the specified folder. |
Methods
| Method | Description |
|---|---|
| Copy | Copies the specified folder from one location to another. |
| Delete | Deletes the specified folder. |
| Move | Moves the specified folder from one location to another. |
| CreateTextFile | Creates a new text file in the specified folder and returns a TextStream object to access this file. |