Make an Annoying Program That Opens and Closes All Your Cd Drives

by liam6058 in Circuits > Software

363232 Views, 22 Favorites, 0 Comments

Make an Annoying Program That Opens and Closes All Your Cd Drives

CD drive 2.jpg
microsoft_vista-logo-300x299.png
this is my first Instructable so please tell me how I can improve.

this instructable tells you how to make an annoying program that opens and closes all your cd drives.

you will need:
a computer running windows

Open Notepad

microsoft Notepad 2007.png
first, open notepad
there are 2 ways I know of to do this
way 1:click the start button, go to programs or all programs, go to accessories click on notepad
way 2:hold down the windows key then press R then release the windows key, a box will pop up, in that box type notepad

Type the Script

1.bmp
the notepad window should now be open
copy and paste the text below into notepad

do
Dim ts
Dim strDriveLetter
Dim intDriveLetter
Dim fs 'As Scripting.FileSystemObject
Const CDROM = 4
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
strDriveLetter = ""
For intDriveLetter = Asc("A") To Asc("Z")
Err.Clear
If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then
If Err.Number = 0 Then
strDriveLetter = Chr(intDriveLetter)
Exit For
End If
End If
Next
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
For d = 0 to colCDROMs.Count - 1
colCDROMs.Item(d).Eject
Next 'null

For d = 0 to colCDROMs.Count - 1
colCDROMs.Item(d).Eject
Next 'null

set owmp = nothing
set colCDROMs = nothing
loop

Save and Test

save the file as cd.vbs on your desktop and double click it to run

Make It Stop

press ctrl+alt+delete
open task manager
click processes
click wscript.exe
press end process