Post: [VBS] Script to annoy friends
03-02-2014, 04:58 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So we've just entered March which means April Fools is just a month away! With this script you can annoy your friends by constantly opening their CD drives - even when they manually close the drive it will pop back open. It's nothing special, just something to annoy people with. Maybe they play a game like League of Legends and you tell them this program gives unlimited health when opened or something... how they open it is down to you!

Lets get started anyway, firstly this script can be written in notepad (yay simple), so the first step is to open Notepad and copy and paste the following code into it...

    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


If you understand code then you will know exactly what everything means - if you don't, I'm not going to explain every line but it simple makes the computer pop open the CD drive. After you've done that, go to Save As and call it something that is going to get your friends to open. The extension of the file needs to be .vbs so when you are saving, replace the "Save as type" field to "All Files (.)" and name the file anything.vbs - if the file type isn't .vbs then nothing will happen once opened apart from revealing the code.

Closing the script[/b]
To close the script simply go to Task Manager > Processes > Wscript.exe > End Process.

Have fun Smile

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo