Folders.Item : Folders « MS JScript « JavaScript Tutorial






Syntax

folderscollection.Item(foldername)

The Item property returns foldername folder.

<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.Item(2).Name);
    }
    // End hide-->
    </script>
    Get the second item added to the c:\temp Folders collection.
    <form name="myForm">
    <input type="Button" value="Get Item" 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