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

309,088

22

62

Posted

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

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

Step 1: Open Notepad

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

Step 2: Type the Script

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

Step 3: Save and Test

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

Step 4: Make It Stop

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

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

58 Comments

at a libray you run this program on ALL the computers and then leave.

I'v done something very similar at my library. I use other peoples codes to log into their system all of the time so one day i decided to do something stupid. The CD drives would pop open cause that's all that they could do, and then you couldn't close it cause it would just pop out again as soon as you are to close the CD drive :)

i did this using a different code which is Set oWMP = CreateObject("WMPlayer.OCX.7")

Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 5000
loop

how do i stop this one ?????

I've got a different version of this I made at college and it does it all silently and opens and closes it randomly, The only way you could stop it is to go into task manager, processes and then end the .vbs script. We also made one that flashes the caps, num and scroll lights and then another that presses caps lock randomly. It was worth the one week internet ban lol

nice, do you have the code for the caps lock flash?

better yet put this on a cd along with a autorun.inf, and make a cd cover like (some awsome game for pc...) and when they put in the cd it spits it right back out =)

print trollface on the disk.

Hi, can someone please help me?
Always when I start the programm pop ups a window which says:
Syntaxerror Code: 800A03EA
The Error is on Line 8 the 9th Char

Thank You
Flo0010

Well then, go to the 8th line and 9th character and see what it is..
Then fix it. Simple as.

I tried this on my laptop.....didn't work. =/