Your Internet Explorer is too old :( Please upgrade to latest IE or switch to Firefox/Google Chrome for better view!

October 30, 2011

Cool VBScript Prank

One day I was looking at vbs file which auto type in notepad, and then I got idea to modify it and making it little bit crazier.
I added some new functions and methods to the script, try it I’m sure you’ll like it.

What this script will do:
It’ll first start your browser then will type some urls then play with your browser’s TAB, at the end it’ll start Microsoft speech engine and gives audio message to your friend about the prank.

Download this file "Browser_Prank.vbs"
Browser_Prank.vbs
or
Copy this code below and paste to notepad then save as "Browser_Prank.vbs"

'################################################################
' File: Browser_Prank.vbs
' Author: 5um17
' URL: http://www.secretsofgeeks.com
' Launch browser, open sites, switch tabs, show msgbox, speak msg.
' Modify and redistribute the script but leave this attribution here.
'################################################################
WScript.Sleep 5000
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "http://www.google.com/"
WScript.Sleep 2000
oShell.AppActivate "http://www.google.com/"
WScript.Sleep 1000
oShell.SendKeys "^t"
WScript.Sleep 1000
oShell.SendKeys "http://by-nick.blogspot.com/"
oShell.SendKeys "~"
WScript.Sleep 1000
oShell.SendKeys "^t"
WScript.Sleep 1000
oShell.SendKeys "http://www.facebook.com/SOCGs"
oShell.SendKeys "~"
WScript.Sleep 3000
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
oShell.SendKeys "^{TAB}"
WScript.Sleep 500
return=msgbox("So Do you want somthing more ? click OK  :-D",48,"msg by nick")
CreateObject("SAPI.SpVoice").Speak "It's ok. Prank by Secrets of Computer Geeks"
 
'##### End

How it is working:
This script using mainly three methods Run, SendKeys and sleep.
The things you’ll note here that script is sending some special key combination for browser shortcut key like Ctrl+TAB to switch between tabs.

There are some methods described with their purpose:

Sleep 5000: initially we call this method for start execution after some time of launching the script. Time is in milliseconds (5000 = 5 sec)
Run “http://www.google.com/”: starting default browser and displaying initial page.
SendKeys "^t": special key CTRL+T for opening new tab in browser.
SendKeys "~": for sending ENTER
msgbox: displaying a popup message box.
CreateObject("SAPI.SpVoice").Speak: object creation for speech engine and calling of speak method for making windows to speak.

It is working almost with every modern browser and windows operating system that allows VBScript execution.
Try it and have fun.

2 comments: