02-15-2006 08:13 PM
02-16-2006 12:22 PM - edited 02-16-2006 12:22 PM
I'm sure there are more elegant and complicated ways to accomplish this using Windows SDK function calls to kernel32.dll or something extravagant like that, but if you want the bare-bones easy way to check if the CD-ROM tray is currently opened, then simply use System Exec to query the CD-ROM drive from the command line. One example of this is shown below.
Use the command line function cmd /c d:, where d: is your CD-ROM drive. If the Standard Error output from System Exec.vi is "The device is not ready." followed by a carraige return and line feed, then voila, your CD-ROM drive is open. If not, it's closed. Anyone have a better idea? I'm sure one exists...
Message Edited by Jarrod S. on 02-16-2006 12:23 PM
02-16-2006 01:19 PM
02-16-2006 01:24 PM