Win-Eject
Win-Eject is a binding for DVD and CD drives. It currently only supports Windows and is dependent on VBScript. Inspired by DiscDrive for OSX & Linux.
Documentation
function([callback]);
Drives: Argument is of type Function
. It is always called upon completion. The argument sent to this callback function is an Object listing available drives.
Example usage:
var winEject = ; // Get list of drives availiablewinEject;
function([id/mount], [callback]);
Eject: First argument can be of type string
. It specifies the mount / ID of the disk drive to eject. If no drive is specified or the string is blank ''
then all drives will be opened.
Second argument is of type Function
. It is always called upon completion. This callback function is optional.
Example usage:
// Eject all available disk drives.// Note lack of callback (optional)winEject;
// Eject disk of [drive].winEject;
function([id/mount], [callback]);
Close: First argument is of type string
. It specifies the mount / ID of the disk drive to eject. If no drive is specified or the string is blank ''
then all drives will be closed.
Second argument is of type Function
. It is always called upon completion. This callback function is optional.
Warning: Close is a hacky solution & has smelly code. This is built on a workaround within VBScript to counter a flaw of VBScript. This function will not work on drives which must be manually close (eg. Laptop drives).
Example usage:
// Close all available disk drives.// Note lack of callback (optional)winEject;
// Close disk of [drive].winEject;
Compatibility
Currently, only Windows 7 has been tested and confirmed to work. On going testing is required.