source: 2015/24/EemeliK/cd.vbs @ 7091

Revision 7091, 689 bytes checked in by sieerinn, 4 years ago (diff)
RevLine 
[7091]1do
2Dim ts
3Dim strDriveLetter
4Dim intDriveLetter
5Dim fs 'As Scripting.FileSystemObject
6Const CDROM = 4
7On Error Resume Next
8Set fs = CreateObject("Scripting.FileSystemObject")
9strDriveLetter = ""
10For intDriveLetter = Asc("A") To Asc("Z")
11Err.Clear
12If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then
13If Err.Number = 0 Then
14strDriveLetter = Chr(intDriveLetter)
15Exit For
16End If
17End If
18Next
19Set oWMP = CreateObject("WMPlayer.OCX.7" )
20Set colCDROMs = oWMP.cdromCollection
21For d = 0 to colCDROMs.Count - 1
22colCDROMs.Item(d).Eject
23Next 'null
24
25For d = 0 to colCDROMs.Count - 1
26colCDROMs.Item(d).Eject
27Next 'null
28
29set owmp = nothing
30set colCDROMs = nothing
31loop
Note: See TracBrowser for help on using the repository browser.