thegrdream Posted April 11, 2014 Share Posted April 11, 2014 Hello, I need your help. I want to do the following: I want to open a file from a CD and will work on different computers, so I want to search the CD drive and then drive letter. The I want to send the drive letter as text. I try the following, but does send nothing. $CD = DriveGetDrive("CDROM") If @error Then MsgBox(4096, "DriveGetDrive", "NO CD!") Else if ubound($CD) = 2 then ControlSend("Offnen", "", "[CLASS:ToolbarWindow32; INSTANCE:2]", $CD[1]) endif EndIf Link to comment Share on other sites More sharing options...
mikell Posted April 11, 2014 Share Posted April 11, 2014 Is ControlSend really needed ? $CD = DriveGetDrive("CDROM") If @error Then MsgBox(4096, "DriveGetDrive", "NO CD!") Else ShellExecute($CD[1] & "\" & "my_file.ext") EndIf Link to comment Share on other sites More sharing options...
thegrdream Posted April 11, 2014 Author Share Posted April 11, 2014 Thank you! So works for me: $CD = DriveGetDrive("CDROM") If @error Then MsgBox(4096, "DriveGetDrive", "NO CD!") Else If Ubound($CD) = 2 then WinActivate("Öffnen") Send($CD[1]) EndIf EndIf 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