Folders.Count : Folders « MS JScript « JavaScript Tutorial






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>








32.13.Folders
32.13.1.Folders
32.13.2.Folders.Add()
32.13.3.Folders.Count
32.13.4.Folders.Item