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


JAVASCRIPT TUTORIALS » MS JScript » FileSystemObject »

 

FileSystemObject.GetDrive()









Syntax








filesystemobject.GetDrive(drive)



The GetDrive() method is used to determine the drive specified in the drive parameter. This method takes drive as its only parameter, which represents the letter of drive for which to get information.












<html>
    <body>
    <script language="JScript">
    <!--
    function getdrive()
    {
        var myObject, drive;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        drive = myObject.GetDrive("c:\")
        alert("Drive Name of drive C is: " + drive.VolumeName);
    }
    -->
    </script>
    Get the name for Drive C.
    <form name="myForm">
    <input type="Button" value="Get Drive Name" onClick='getdrive()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» FileSystemObject