Ein Script um CD-Laufwerke zu Öffnen oder zu Schließen.
.exe und au3 im Anhang.
Ein Script um CD-Laufwerke zu Öffnen oder zu Schließen.
.exe und au3 im Anhang.
Sorry, aber ich glaube nicht dass das sehr sinnvoll ist...
Sorry, aber ich glaube nicht dass das sehr sinnvoll ist...
Doch für Personen die gerne mit Sekundenkleber spielen und sich dabei aus versehen die Hände an Maus und Tastatur festkleben
Habs mal aus Fun ein wenig verbessert:
#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit]Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]HotKeySet("o", "op");Hotkey zum Öffnen des CD-Laufwerks
HotKeySet("c", "cl");Hotkey zum Schließen des CD-Laufwerks
HotKeySet("e", "ex");Hotkey zum Beenden
MsgBox(0, "Hotkeys", "Press o for Open CD" & @CRLF & "Press c for Close CD" & @CRLF & "Press e for Exit") ;MsgBox vor dem Start
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("CD Mover", 100, 115, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "ex")
$hOpen = GUICtrlCreateButton("CD Öffnen (o)", 0, 10, 100, 25, 0)
GUICtrlSetOnEvent(-1, "op")
$hClose = GUICtrlCreateButton("CD Schließen (c)", 0, 45, 100, 25, 0)
GUICtrlSetOnEvent(-1, "cl")
$hExit = GUICtrlCreateButton("Beenden (e)", 0, 80, 100, 25, 0)
GUICtrlSetOnEvent(-1, "ex")
GUISetState()
While 1
Sleep(10)
WEnd
Func op()
$aDrive = DriveGetDrive("CDROM")
If Not IsArray($aDrive) Then
MsgBox(16, "Error", "Kein Laufwerk gefunden.")
Return
EndIf
For $i = 1 To UBound($aDrive) - 1
CDTray($aDrive[$i], "open")
Next
EndFunc ;==>op
Func cl()
$aDrive = DriveGetDrive("CDROM")
If Not IsArray($aDrive) Then
MsgBox(16, "Error", "Kein Laufwerk gefunden.")
Return
EndIf
For $i = 1 To UBound($aDrive) - 1
CDTray($aDrive[$i], "close")
Next
EndFunc ;==>cl
Func ex()
Exit
EndFunc ;==>ex
danke Molaynox für den Code
hab den Download Aktualisiert