The Count property returns the number of folders in the collection. Folders are added to this collection by using the Folders.Add() method.
<html>
<body>
<script language="JScript">
<!--
function get(){
var myFileSysObj = new ActiveXObject("Scripting.FileSystemObject");
var myFolder = myFileSysObj.GetFolder("c:\\Temp");
var myFolderCollection = myFolder.SubFolders;
myFolderCollection.Add("test1");
myFolderCollection.Add("test2");
alert(myFolderCollection.Count);
}
// End hide-->
</script>
Get the count of the c:\temp Folders collection.
<form name="myForm">
<input type="Button" value="Get Count" onClick='get()'>
</form>
</body>
</html>