Eject my cd drive 
Author Message
 Eject my cd drive

Is it possible to eject my cd drive from a VBScript fil ?

Jens from Denmark



Sun, 16 Feb 2003 03:00:00 GMT  
 Eject my cd drive

I got this from a newsgroup post, but neglected to record who gets the credit for it.  If I were to guess, I would say Walter Zachary.

Option Explicit
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
Set Shell = Nothing
Set System = Nothing

--

Bill James
Microsoft MVPDTS

?Free Win9x VBScript Utilities?
http://www.svvi.net/wgjames/vbspage/

Quote:

> Is it possible to eject my cd drive from a vbscript fil ?

> Jens from Denmark



Sun, 16 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Eject my cd drive ?

2. Eject CD in case of 2 CD drives

3. EJECT CD from CD Drive ???

4. API to eject cd-rom-drive?

5. lock / disable the CD Drive eject

6. Ejecting CD from drive

7. *Help* Ejecting CD drives

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

9. Ejecting the cd-rom drive

10. How to eject a Cd when are multiple CDs

11. Ejecting CD's

12. Eject CD-ROM

 

 
Powered by phpBB® Forum Software