8daysaweek.co.uk Posted October 15, 2005 Share Posted October 15, 2005 I have searched and found some possible solutions but they don't seem as simple as they *should*?I'd like to be able to create a button which will eject a CD tray.I know about CDTray ( "drive", "status" ) but the problem is I don't know what the CD drive letter will be on each different machine.I'm working on a solution using DriveGetDrive( "CDROM" ) and If FileExists () as I don't want the wrong tray to be ejected if there is more than one CD drive on a computer.However, as the script will be run from the CD drive, I thought there might be a way to just find the current drive's letter, then use it in CDtray().TIA , [size=15]James :)[/size]www.8daysaweek.co.uk - A User-Focused OOo site, with Forums, Help Centre,Easy Installation CDs & OOo on USB Key Link to comment Share on other sites More sharing options...
w0uter Posted October 15, 2005 Share Posted October 15, 2005 (edited) @scriptXXX & some stringXXX functions should get it easily. but can a script eject itself ? MsgBox(0, 'Run From', StringLeft(@scriptdir, 2)) Edited October 15, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
8daysaweek.co.uk Posted October 15, 2005 Author Share Posted October 15, 2005 Hi w0uter,@scriptXXX & some stringXXX functions should get it easily.They do, thank you but can a script eject itself ?It works, so it would appear the answer is yes Thanks for your help BFN, [size=15]James :)[/size]www.8daysaweek.co.uk - A User-Focused OOo site, with Forums, Help Centre,Easy Installation CDs & OOo on USB Key Link to comment Share on other sites More sharing options...
Rick Posted October 16, 2005 Share Posted October 16, 2005 Hi w0uter,They do, thank you It works, so it would appear the answer is yes Thanks for your help BFN, this may help as i found it for another of my programshkcu/Software\Microsoft\Windows\Currentversion\Explorer\CD BurningaDrive Index gives the number of the burning drive.Hk Users\.DEFAULT\Software\Microsoft\Windows\Currentversion\Explorer\MountPoints2 list all available drivesmatch the number to the drive and you have your cd burning driveit shouldnt be too difficult in AutoIt Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
monter Posted December 9, 2005 Share Posted December 9, 2005 I have searched and found some possible solutions but they don't seem as simple as they *should*?I'd like to be able to create a button which will eject a CD tray.I know about CDTray ( "drive", "status" ) but the problem is I don't know what the CD drive letter will be on each different machine.Maybe this topic will help you:http://www.autoitscript.com/forum/index.php?showtopic=16588 monter.FM [font="Tahoma;"]Full programs:[/font][font="'Microsoft Sans Serif';"] LogOnOff - keeps alive user session, after set time it performs logoff (instead of locking [acronym="Personal Computer"]PC[/acronym], useful in some corporations working with [acronym="Active Directory"]AD[/acronym]).[/font] ČharCönvěr - character set converter. [font="'Microsoft Sans Serif';"]CDTray - automated opening/closing the [acronym="Compact Disc"]CD[/acronym] tray.[/font] [font="'Microsoft Sans Serif';"]Example scripts: [/font][font="'Microsoft Sans Serif';"]RecentFolders - managing recently used folder list with combobox.[/font] [font="'Microsoft Sans Serif';"]AutoUpdater - periodic auto-checking, auto-updating and auto-relaunching newest script version.[/font] Changed host from monter.homeip.net to monter.homenet.org - replace address in my scripts to get back them to work. Link to comment Share on other sites More sharing options...
tuape Posted December 9, 2005 Share Posted December 9, 2005 I have searched and found some possible solutions but they don't seem as simple as they *should*? I'd like to be able to create a button which will eject a CD tray. I know about CDTray ( "drive", "status" ) but the problem is I don't know what the CD drive letter will be on each different machine. I'm working on a solution using DriveGetDrive( "CDROM" ) and If FileExists () as I don't want the wrong tray to be ejected if there is more than one CD drive on a computer. However, as the script will be run from the CD drive, I thought there might be a way to just find the current drive's letter, then use it in CDtray(). TIA , How about this: $var = DriveGetDrive ( "CDROM" ) CDTray($var[1], "open") Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now