Mega Code Archive

 
Categories / JavaScript Tutorial / MS JScript
 

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>