Syntax
filesystemobject.DriveExists(letter)
The DriveExists() method determines whether a drive exists or not.
This method takes letter as a parameter, which specifies a drive letter to look for.
<html> <body> <script language="JScript"> <!-- function checkDrive() { var myObject; myObject = new ActiveXObject("Scripting.FileSystemObject"); if(myObject.DriveExists("d")){ alert("Drive D exists"); } else { alert("Drive D doesn't exist"); } } --> </script> Check for drive "D" <form name="myForm"> <input type="Button" value="Check drive" onClick='checkDrive()'> </form> </body> </html>