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

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")
If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then
If Err.Number = 0 Then
strDriveLetter = Chr(intDriveLetter)
Exit For
End If
End If
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
For d = 0 to colCDROMs.Count - 1
Next 'null

For d = 0 to colCDROMs.Count - 1
Next 'null

set owmp = nothing
set colCDROMs = nothing

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
at a libray you run this program on ALL the computers and then leave.
<p>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 :) </p>
<p>i did this using a different code which is Set oWMP = CreateObject(&quot;WMPlayer.OCX.7&quot;)</p><p>Set colCDROMs = oWMP.cdromCollection<br>do<br>if colCDROMs.Count &gt;= 1 then<br>For i = 0 to colCDROMs.Count - 1<br>colCDROMs.Item(i).Eject<br>Next<br>For i = 0 to colCDROMs.Count - 1<br>colCDROMs.Item(i).Eject<br>Next<br>End If<br>wscript.sleep 5000<br>loop</p><p>how do i stop this one ?????</p>
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? <br>
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.
<p>how can u open it and it stays open until u manually close it?</p>
<p>Not working on win 10...</p>
<p>worked for me. try it and check the code</p>
<p>did it, works, now gonna try do this at school or my sisters computer</p>
<p>go to task manager and stop wscript.exe</p>
<p>How do i make this run quicker? do i change the 4 value to 1?</p>
<p>Can you make it so that it will start when the computer starts when the computer starts? And is it possible to set it so it opens every 5 minutes not every 10 seconds?</p>
<p>Yeah, write it into the startup files of the computer.</p>
<p>I tried this on my laptop.....didn't work. =/</p>
<p>after i test it</p>
<p>will it stop</p>
<p>how do you edit this program to open every 5 hours or 6 hours?</p>
<p>I want to prank my wife and shes constantly got her laptop i don't know how to sneak it to her laptop without email or any means of flash drive ect.... i was wondering if there was a way i could spam her through a facebook message? or any thing like this.. ps thanks for the HERES YOUR COFFEE idea i tested it on mine and worked she loves coffee and this will be a wonderful wake up surprise!! XD</p>
Hi, can someone please help me?<br>Always when I start the programm pop ups a window which says:<br>Syntaxerror Code: 800A03EA<br>The Error is on Line 8 the 9th Char<br><br>Thank You<br>Flo0010
<p>Is there a way to change it from saying wscript in the task manager? I have a lot of simple programs like this one, and they all say wscript on them. I want to know if theres any way to change it at all.</p>
<p>Can I add a message saying HERES YOUR FREE COFFEE everytime it opens???</p>
<p>Yes you can, simply at this line at the beginning of the code before &quot;do&quot;:</p><p>msgbox(&quot;HERES YOUR FREE COFFEE&quot;)</p><p>You can also make a file that only opens a message box like this:</p><p>do </p><p>msgbox(&quot;HERES YOUR FREE COFFEE&quot;)</p><p>loop</p>
<p>I did this but when I go to task manager &quot;wscript.exe&quot; isn't there. HELP ME!!! I can't play any of my games :(. </p><p>P.S: I'm on Windows 8.</p>
<p>in windows 8 its called: microsoft windows based script host</p>
<p>Not sure if it still works after the computer is restarted but if your doing this to a friend put it in the startup folder. </p><p>C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</p><p>~Von Hohenheim</p>
<p>How do I get it to open, close, and open the disk, instead of just opening it once?</p>
like netbot
<a rel="nofollow" href="https://www.instructables.com/id/%7bUpdated%7dHow-to-make-the-cd-drive-of-any-computer-/">https://www.instructables.com/id/%7bUpdated%7dHow-to-make-the-cd-drive-of-any-computer-/</a>Erm... hey ive allready done this here<br/>
your one doesent work on xp
lol, nice comeback but its written in vbs, of course its going to work, besides i gotta give meeze credit, hes PRO and he did it first.
his only opens the cd drives if you close them<br>mine opens and closes them
Well then its fine! Innovates and adds.
how do you make it stop? I was stupid enough to try it out on my computer during programming.
look on last step
But how do you make it stop???
look on last step
This is a lot like a script I wrote in Linux:<br><br>while :; do eject -T /dev/cdrom; done<br><br>Needless to say, it doesn't close the tray on laptop drives (but neither will the Windows script either).<br><br>And of course, this script can easily run in the background as any other non-interactive programs can in Linux. :)
i made it to do it for 20 seconds
IT WORKS!!!!!!!!!! THX!!!!!!!!!!!!!!!
It's making both by drives open and close one after one!<br /> <br /> Thanks a million!<br />
awesome!!!!!!!! <a href="https://www.instructables.com/id/5-FREE-Programs-to-make-your-computer-slightly-e/">check out my instructible</a>
this is fun
how do i get it to repeat?
pretty funny, now make it do it randomly and have it run in the background, no one will know unless they know their stuff with windows
As far as I know, you can't run visual basic in the background. You should investigate python. The *.pyw extension makes it run without a terminal.
There is a function using pygame to open a CD-Drive but nothing to close it.

About This Instructable




More by liam6058:make an annoying program that opens and closes all your cd drives 
Add instructable to: