bobheart Posted June 14, 2004 Share Posted June 14, 2004 this opens my cdtray but can you do it with have the drive letter ? CDTray("F:", "open") Link to comment Share on other sites More sharing options...
pekster Posted June 14, 2004 Share Posted June 14, 2004 can you do it with have the drive letter ?Sorry, that just makes no sense to me. You need to give it both arguments if that's what you mean, yes. If not, please clarify. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
bobheart Posted June 14, 2004 Author Share Posted June 14, 2004 (edited) Sorry i took my pills so kind of out of it right now . Can you have it open a cdrom with out saying the drive letter ? Like if you don't know what the drive letter would be on their computer. Like MCI commands : MCICommand("set cdaudio door open") MCICommand("set cdaudio door closed" Edited June 14, 2004 by bobheart Link to comment Share on other sites More sharing options...
pekster Posted June 14, 2004 Share Posted June 14, 2004 No, but you could have it try the letters D through Z until it finally does open one. Like this: ;create an array with the drive letters D through Z: $driveArray = StringSplit("DEFGHIJKLMNOPQRSTUVWXYZ", "") For $i = 1 To 23 ;we have 23 elements in our array, so at most do this 23 times $opened = CDTray($driveArray[$i] & ":", "open") If $opened Then ExitLoop ;it worked, so don't keep trying more drive letters Next If NOT $opened Then ;it failed, so let the user know and exit MsgBox(0, "Failed", "Sorry, could not find a CD drive that would let me open it") Exit EndIf [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
bobheart Posted June 14, 2004 Author Share Posted June 14, 2004 Thank you again .. I must bug the hell out of you . lol But I'm happy for everything you help me with .. Link to comment Share on other sites More sharing options...
herworth Posted June 14, 2004 Share Posted June 14, 2004 Just an additional thought: for $i = 68 to 90 $opened = CDTray(Chr($i) & ":", "open") ... etc This saves inputting all that alphabet. [u][font="Arial"]Pete[/font][/u] Link to comment Share on other sites More sharing options...
tuape Posted June 14, 2004 Share Posted June 14, 2004 Hi, This might also work: $var = DriveGetDrive ( "CDROM" ) CDTray($var[1], "open") Please take a look at the help file how DriveGetDrive works, I'm not sure if it is like suggested above. Cheers, Tuape Link to comment Share on other sites More sharing options...
pekster Posted June 14, 2004 Share Posted June 14, 2004 (edited) $var = DriveGetDrive ( "CDROM" ) CDTray($var[1], "open") Please take a look at the help file how DriveGetDrive works, I'm not sure if it is like suggested above.Looks good, but be sure to test for the DriveGetDrive function failing (if there are no CDROM drives on the system.) Either check for $var = 1, or for @error. And I never saw that function before (or looked long enough to notice.) Ya learn something new every day Minor edit Edited June 14, 2004 by pekster [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. 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