Jump to content

Eject CD after Installation


Recommended Posts

Hi,

I search for a soulution where I can eject my CD-ROM Drive when the unattended CD is finished...

I searched the web, but I don´t found anything. I Tryed a Dos-Tool called:

"fxeject" but it needed MSCDEX.EXE be loaded.

Have anyone a soulution for this?

Edit

found this code (its ActiveVB) but I don´t can compile it :) :

'Dieser Source stammt von http://www.activevb.de
'und kann frei verwendet werden. Für eventuelle Schäden
'wird nicht gehaftet.

'Um Fehler oder Fragen zu klären, nutzen Sie bitte unser Forum.
'Ansonsten viel Spaß und Erfolg mit diesem Source!

'------------- Anfang Projektdatei Project1.vbp -------------
'--------- Anfang Formular "Form1" alias FORM1.FRM  ---------
' Steuerelement: Schaltfläche "Command2"
' Steuerelement: Schaltfläche "Command1"

Option Explicit

'Deklaration: Globale Form API-Funktionen
Private Declare Function mciExecute Lib "winmm.dll" (ByVal  _
lpstrCommand As String) As Long

Private Sub Command1_Click()
   'Laufwerkstür öffnen
   Call mciExecute("Set CDaudio door open")
End Sub

Private Sub Command2_Click()
   'Laufwerkstür schließen
   Call mciExecute("Set CDaudio door closed")
End Sub

Private Sub Form_Load()
   'Control-Eigenschaften initialisieren
   Command1.Caption = "Auf"
   Command2.Caption = "Zu"
End Sub
'---------- Ende Formular "Form1" alias FORM1.FRM  ----------
'-------------- Ende Projektdatei Project1.vbp --------------

Link to comment
Share on other sites


From Webmedic's post on 2 CD Installation, create a vbs script as follows;

Set oWMP = CreateObject("WMPlayer.OCX.7" )

Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then

For i = 0 to colCDROMs.Count - 1

colCDROMs.Item(i).Eject

Next ' cdrom

End If

Then save this as "CDEJECT.VBS", or any name with VBS extension. You can the just doubleclick or run the vbs script to eject your CD.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...