FileSystemObject.FolderExists() : FileSystemObject : MS JScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » MS JScript » FileSystemObject »

 

FileSystemObject.FolderExists()










Syntax:








filesystemobject.FolderExists(foldername)



The FolderExists() method determines whether a specified folder exists.

This method takes foldername as its only parameter.












<html>
    <body>
    <script language="JScript">
    <!--
    function checkfolder()
    {
        var myObject;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        if(myObject.FolderExists("c:\tmp")){
            alert("tmp Folder Exists");
        }  else {
            alert("tmp Folder doesn't exist");
       }
    }
    -->
    </script>
    Check for folder "tmp"
    <form name="myForm">
    <input type="Button" value="Check Folder" onClick='checkfolder()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» FileSystemObject