Folders.Item : Folders : MS JScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » MS JScript » Folders »

 

Folders.Item









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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» Folders