CDTray

From AutoIt Wiki

Jump to: navigation, search

Opens or closes the CD tray. Adapted from AutoIt docs.

Contents

[edit] Syntax

CDTray("drive","status")

[edit] Parameters

driveThe drive letter of the CD tray to control in the format D:, E:, etc.
statusSpecifies if you want the CD tray to be open or closed: "open" or "closed"

[edit] Return Value

Success: Returns 1. Failure: Returns 0 if drive is locked via CD burning software or if the drive letter is not a CD drive.

[edit] Example

; Open the CD tray on drive E:
CDTray("E:", "open")

[edit] Remarks

CDTray works as expected with virtual CD drives such as DAEMON Tools. CDTray does not work on non-local/mapped CD drives; CDTray must be run from the computer whose drive it affects. CloseTray("x": "close") tends to return 0 on cd trays that must be closed manually.

[edit] Related Functions

DriveGetType DriveStatus

Personal tools