Javascript IsReady property of Drive object returned by the FileSystemObject’s GetDrive method returns the Boolean value i.e. true or false based on the ready state of specified drive. Basically IsReady property works for removable drives such as CD-Rom drive or Floppy drive that changes their status according to disc inside them. When a user inserts a CD into the CD drive then its status changes from loading to reading and then ready to use. IsReady property of Drive object returns true when specified drive enters the ready state.
Example of JavaScript Drive Object IsReady Property
<script type="text/javascript">
// initialize ActiveXObject and create an object of Scripting.FileSystemObject.
var fso = new ActiveXObject("Scripting.FileSystemObject");
// Drive object reference set to driveObj variable
var driveObj = fso.GetDrive("E");
if (driveObj.IsReady) {
document.write("Drive <b>" + driveObj.DriveLetter + "</b> is ready to use.");
}
else {
document.write("Drive <b>" + driveObj.DriveLetter + "</b> is not ready to use.");
}
// Output:
// Drive E is not ready to use.
</script>
Continue to next tutorial: Javascript FSO Drive Object Path property to learn how to get the path related to the specified drive.