You create an ActiveX File System object by calling ActiveXObject() with a single argument, Scripting.FileSystemObject:
myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
You create a folder object by using the ActiveX's GetFolder() method:
myFolder = myActiveXObject.GetFolder("c:\\temp");
Here are the Folder object's properties:
| Property | Description |
Attributes | Refers to the folder attributes |
DateCreated | Returns the folder's creation date |
DateLastAccessed | Returns the folder's last-accessed date |
DateLastModified | Returns the folder's last-modified date |
Drive | Returns the folder's letter drive |
Files | Returns the folder's files collection, containing all the file objects in the folder |
IsRootFolder | Returns true if the folder is the root folder, false otherwise |
Name | Returns the folder name |
ParentFolder | Returns the folder's parent folder name |
Path | Returns the folder's long path |
ShortName | Returns the folder's short name |
ShortPath | Returns the folder's short path |
Size | Returns the folder size |
SubFolder | Returns a folders collection of all folders contained in the folder |
Type | Returns the folder type |
Here are the Folder object's methods:
| Method | Description |
Copy() | Copies the folder from its parent folder or the root to another folder or the root |
Delete() | Removes the folder |
Move() | Moves the folder from its parent folder or the root to another folder or the root |
People who read this tip also read these tips:
Look for similar tips by subject:
|