Eject CD-ROM 
Author Message
 Eject CD-ROM

Hi,

I'm looking for a way to eject a cd from a cd-rom drive. Any ideas?

Wim
--
http://www.*-*-*.com/
Alles over Windows 2000 en NT

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 21 Jan 2003 03:00:00 GMT  
 Eject CD-ROM


writes
[snip]

Quote:
>I'm looking for a way to eject a cd from a cd-rom drive. Any ideas?

1) Press the eject button
2) Find the device in explorer and right click eject.
3) It seems that 2) is actually implemented by a call of
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, ByVal wReturnLength As Integer, _
ByVal hCallback As Integer) As Long
"Windows Scripting Secrets" ISBN 0-7645-4684-8
provides object access to that function so that the following works
set mci = createobject("mci.manager")
mci.sendmcistring("set cdaudio door open wait")

There are doubtless other ways but that is all I know!
--
Walter Briscoe



Tue, 21 Jan 2003 03:00:00 GMT  
 Eject CD-ROM

This script will work for you if you have the Desktop Update
installed.

Dim Shell
Dim System
Dim Count
Dim Drive
Set System = CreateObject("Scripting.FileSystemObject")
For Count = Asc("d") To Asc("z")
   If System.DriveExists(Chr(Count)) Then
      Set Drive = System.GetDrive(Chr(Count))
      If Drive.DriveType = 4 Then
         On Error Resume Next
         Set Shell = CreateObject("Shell.Application").NameSpace(17)
         Shell.ParseName(Drive & "\").InvokeVerb("e&ject")
         Exit For
      End If
   End If
Next 'Count


:
:
: Hi,
:
: I'm looking for a way to eject a cd from a cd-rom drive. Any ideas?
:
: Wim
: --
: http://www.win2kwereld.nl
: Alles over Windows 2000 en NT
:
:
: Sent via Deja.com http://www.deja.com/
: Before you buy.



Tue, 21 Jan 2003 03:00:00 GMT  
 Eject CD-ROM


Quote:

> This script will work for you if you have the Desktop Update
> installed.

> Dim Shell
> Dim System
> Dim Count
> Dim Drive
> Set System = CreateObject("Scripting.FileSystemObject")
> For Count = Asc("d") To Asc("z")
>    If System.DriveExists(Chr(Count)) Then
>       Set Drive = System.GetDrive(Chr(Count))
>       If Drive.DriveType = 4 Then
>          On Error Resume Next
>          Set Shell = CreateObject("Shell.Application").NameSpace(17)
>          Shell.ParseName(Drive & "\").InvokeVerb("e&ject")
>          Exit For
>       End If
>    End If
> Next 'Count



> :
> :
> : Hi,
> :
> : I'm looking for a way to eject a cd from a cd-rom drive. Any ideas?
> :
> : Wim
> : --
> : http://www.win2kwereld.nl
> : Alles over Windows 2000 en NT
> :
> :
> : Sent via Deja.com http://www.deja.com/
> : Before you buy.

Great! This actually works. Thanx!

Wim
--
http://www.win2kwereld.nl
Alles over Windows 2000 en NT

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 24 Jan 2003 03:00:00 GMT  
 Eject CD-ROM

"...Great! This actually works. Thanx!..."

Walter wouldn't post it if it didn't <g>!

--
Michael Harris
MVP Scripting



Fri, 24 Jan 2003 03:00:00 GMT  
 Eject CD-ROM


Quote:

> "...Great! This actually works. Thanx!..."

> Walter wouldn't post it if it didn't <g>!

The clever thinking surprised us :-)

I was wondering, using the same construction probably other neat things
can be accomplished. Are there any doc's around I could use?
Or in other words, how did Walter find out!

Wim
--
http://www.win2kwereld.nl
Alles over Windows 2000 en NT

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 26 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. API to eject cd-rom-drive?

2. Eject Cd-rom (Again!)

3. Ejecting CD-ROM

4. API to eject CD-ROM disk

5. ejecting CD-Rom with VBScript?

6. Eject CDROM

7. Eject CDRom

8. eject cdrom

9. Newbie question : Ejecting a CD-Rom

10. How to eject a removable disk ( not cd-rom ) from vb5

11. Command for Ejecting the CD-ROM

12. API call to eject/close CD-ROM drives?

 

 
Powered by phpBB® Forum Software