Scripting the File System, Part I: The Folder Object - Doc JavaScript
Scripting the File System, Part I
The Folder Object
GetFolder(pathName) | Object |
This method returns the folder
object of the given folder name. The following script should create a folder
object for f:\yehuda\js\tips
:
<SCRIPT LANGUAGE="JavaScript">
<!--
var fso = new ActiveXObject("Scripting.FileSystemObject");
folderObj = fso.GetFolder("f:\\yehuda\\js\\tips");
-->
</SCRIPT>
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 folder's 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 one folder to another |
Delete() | Removes the folder |
Move() | Moves the folder from one folder to another |
Next: How to use Drives
and GetDrive()
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: November 20, 2000
Revised: November 20, 2000
URL: https://www.webreference.com/js/column71/9.html