Version: 3.0
The Folder object allows you access and manipulate the various properties of a folder.
<%
Dim filesys, demofolder, createdate
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder("foldername")
createdate = demofolder.DateCreated
%>
This code uses the GetFolder method of the FileSystemObject object to obtain a Folder object and view one of its properties.
Syntax: object.Attributes [= newattribute]
This property allows us to get or change the various attributes of a file.
Syntax: object.DateCreated
This property gets the date and time that the folder was created. Syntax: object.
Syntax: object.DateLastAccessed
Gets the date and time that the folder was last accessed.
Syntax: object.DateLastModified
This property gets the date and time that the folder was last modified.
Syntax: object.Drive
Returns the drive letter of the drive where the folder is located.
Syntax: object.Files
Returns a Files collection consisting of all the File objects in the specified folder.
Syntax: object.IsRootFolder
Returns a Boolean value: True if the folder is the root folder, and False otherwise.
Syntax: object.Name
This property lets us get or change the name of the specified folder.
Syntax: object.ParentFolder
This property gets the parent Folder object relating to the specified folder.
Syntax: object.Path
This property returns a folder's path.
Syntax: object.ShortName
Returns the short version of a folder name (using the 8.3 convention). e.g. the folder 'testingshortname' is truncated to 'testin~1'.
Syntax: object.ShortPath
Returns the short version of the folder path (this is the path with any folder and file names truncated as above).
Syntax: object.Size
Returns the size of the specified folder and its contents (in bytes).
Syntax: object.SubFolders
This property returns a Folders collection that consists of all the folders in the specified folder.
Syntax: object.Type
Returns a string containing the folder type description.
Syntax: object.Copy destination[, overwrite]
Copies the specified folder from one location to another.
Syntax: object.CreateTextFile filename [, overwrite[, unicode]]
This method is used to create a text file and returns a TextStreamObject that can then be used to write to and read from the file.
Syntax: object.Delete [force]
Deletes the specified folder.
Syntax: object.Move destination
Moves the specified folder from one location to another.