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

331,804

23

62

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

  • Beauty Tips Contest

    Beauty Tips Contest
  • Classroom Science Contest

    Classroom Science Contest
  • Growing Beyond Earth Maker Contest

    Growing Beyond Earth Maker Contest

62 Discussions

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 :)

0
None
NathanF23StephenN2

Reply 3 years ago

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 ?????

0
None
Joe Martin

9 years ago on Introduction

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

1 reply
0
None
mc_dude

9 years ago on Introduction

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 =)

1 reply
0
None
YiwenW

7 months ago

Does this work on Mac?

0
None
holtreyt1

Question 1 year ago

can you make it close too?

0
None
MajdSy

1 year ago

i tried it it works very well but i need please some tipps, how can i understand this code

0
None
MajdSy

1 year ago

please anyone can explain the code or give tipps

0
None
Flo0010

4 years ago

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

1 reply
0
None
Reformed KyuAFlo0010

Reply 1 year ago

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

0
None

Na dude, all you have to do it read where the error line is and remove the apostrophe and re enter it from your keyboard.

0
None
MegaM5

2 years ago

how can u open it and it stays open until u manually close it?