Introduction: CD Drive Prank

This is my entry into the April Fool's day contest, how to make a visual basic script to annoy people. When run, it opens all the CD drives and then, if they are closed, opens them again. It also only runs on April fools day, so can be set up well in advance! In addition, as it isn't a program, it doesn't show up in applications, so isn't easy to close. The only was to close it is in processes, but they are probably clever enough to know not to muck around blindly closing processes!

Please leave a message of criticism or support, and preferably a rating, so i know if i should bother again! I'd love to hear stories of mayhem as well!

Step 1: Open Notepad

Go to Start, All Programs, Accessories, Notepad.

Step 2: Type in the Code

Insert this code:

Dim myDateString
Dim thing1
thing1 = 0
myDateString = Date()
If myDateString < "02/04/10" Then
thing1 = 1
end if
if thing1 = 1 then 
If myDateString > "31/04/10" Then
    thing1 = 2
end if
end if

if thing1 = 2 then
do 
Set oWMP = CreateObject("WMPlayer.OCX.7" ) 
Set colCDROMs = oWMP.cdromCollection 

if colCDROMs.Count >= 1 then 
For i = 0 to colCDROMs.Count - 1 
colCDROMs.Item(i).Eject 
Next ' cdrom 
End If 

loop
Else     
    wscript.quit 1
End If



Now I'll explain that:

Dim myDateString
Dim thing1

This sets two variables that we can use later on in the code.

thing1 = 0
myDateString = Date()

This sets the variables. thing1 is a numerical value, but myDateString contains the date at which it is being run.

If myDateString < "02/04/10" Then
thing1 = 1
end if
if thing1 = 1 then 
If myDateString > "31/04/10" Then
    thing1 = 2

This detects whether it is April Fool's or not, and then sets thing1 accordingly.

if thing1 = 2 then
do 
Set oWMP = CreateObject("WMPlayer.OCX.7" ) 
Set colCDROMs = oWMP.cdromCollection 

if colCDROMs.Count >= 1 then 
For i = 0 to colCDROMs.Count - 1 
colCDROMs.Item(i).Eject 
Next ' cdrom 
End If 

loop

This actually does the opening and closing. IT calls up a windows media player function to open the drive, then repeats it.


Else     
    wscript.quit 1

This is run if it isn't April Fool's, and closes the file.


Step 3: Save the File

Go to save as, and select "All files" from the second drop down box. Call it anything you want but end it in ".vbs". This means it is saved as a visual basic script an can be run.

Step 4: Select a Disguise

To hide it, we'll make it look like something else. I've used a link to MSN, but you could use any link. You only need to find a suitable one, but I have moved it to make it clearer.

Step 5: Create a Shortcut

Right click on the file you made two steps ago and click "create shortcut".

Step 6: Get Icon Info

Right click on the file you selected to use as a disguise. Go to properties, then go to the tab marked "Shortcut" and click on the button marked "Change Icon". A window should pop up with an address to the dll containing the icon. Copy this address.

Step 7: Change the Shortcut Icon

Repeat Step 6 but instead of copying the address, paste the other one and press enter. The icon from the other link should show up. Select this and close Properties.

Step 8: Rename and Move

You should end up with a file looking identical to the link you found. Change the name to match teh other link and move to startup in the victims documents. (C:\Documents and Settings\(Victim's username)\Start Menu\Programs\Startup) so it runs when they log in.

Step 9: How to Close

If the victim realises you've pranked them, try and run away and hide. If, however, they threaten to torture you, you'll need to be able to close it. Press Control, Alt and Delete together and bring up the task manager. Go to processes and click the very top above all the names to order them alphabetically by name. Scroll down and find "wscript.exe" and close that.