ZOTHOP Posted March 21, 2010 Share Posted March 21, 2010 (edited) Here is my script $var = DriveStatus( "e:\" ) If $var="READY" then Diskoqp() Else ordishut() EndIf Func Diskoqp() CDTray("e:","open") MsgBox(4096,"Careful !","Please remove CD/DVD and retry") EndFunc Func ordishut() Shutdown(1) EndFunc I put a shortcut of my program on Windows Desktop. This code control the CD/DVD drive e:. If there is CD or DVD a message box appear and the drive open, else the computer shutdown I am a novice and I have problems to control USB ports to know if there are drives connect in. Edited March 21, 2010 by ZOTHOP Link to comment Share on other sites More sharing options...
GodlessSinner Posted March 22, 2010 Share Posted March 22, 2010 (edited) If _RemoveMediaDetect() Then MsgBox(0, "", "Removable storage detected") EndIf Func _RemoveMediaDetect() $drive = DriveGetDrive("REMOVABLE") If $drive[0] > 0 And $drive[1] <> "a:" Then Return True Else Return False EndIf EndFunc ..<> "a:" - for ignoring floppy Edited March 22, 2010 by Godless _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
ZOTHOP Posted April 7, 2010 Author Share Posted April 7, 2010 Thank you ! 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