Post Reply 
Basic VBS Tutorial (Useful for trolling friends)
04-24-2012, 01:57 AM
Post: #1
Basic VBS Tutorial (Useful for trolling friends)
Hello,
Im going to show you some really basic VBS (Visual Basic Script) code.
First of all, your gonna need notepad, so open that up.
Now here is the code you can use:
To show a popup you use:
Code:
msgbox"Your Text Here!!"
You can also do multiple messages:
Code:
msgbox"this is the first message"
msgbox"once they hit ok or close, this message pops up"
You can have the user put something in:
Code:
inputbox("your question?")
This will give you a popup with a textfiel were you can put something in
You can assign a userinput to a variable
Code:
userinput = inputbox("whats ur input??")
and you can use that to make something like this:
Code:
name = inputbox("Whats your name?")
age = inputbox("How old are you?")
home = inputbox("where do you live?")
msgbox"so your name is "+name +", you are "+age +" years old, and you live in " +home +"??"
msgbox"your such a bad liar, "+name
as you can see, you will need +es between strings if you add variables to your text.
This will work: "hello" +name +" welcome"
Although this wont: "hello" +name " welcome"
Now, the next pieces of code are just for fun, they dont need explanation:
Code:
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True
This will create a beep sound..
Code:
Dim oWMP
Dim colCDROMs, i
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
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
End If
oWMP.close
Set colCDROMs = Nothing
Set oWMP = Nothing
Opens up your CD drive..
Code:
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.ShutDown()
next
Will Shut down your computer (dont try on self xD)
and finally, an script youll always find useful :
Code:
do
Herecomesapieceofcode
loop
Will loop the piece of code infinitely (Dont try on self in combination with the beep)
Save the code youve put into notepad as yourcodename.vbs (not .vbs.txt)
Thats it, I hope youll troll a lot of friends(or enemies)(or teachers xD)
User Tools
Quote this message in a reply


04-28-2012, 02:49 PM
Post: #2
RE: Basic VBS Tutorial (Useful for trolling friends)
Thanks very much. I will surely try this.
Do you know how I can restart a computer with it?

Thanks Carstensz Pyramid Server and FreeVPS very much my VPS18.
User Tools
Quote this message in a reply
04-28-2012, 07:02 PM
Post: #3
RE: Basic VBS Tutorial (Useful for trolling friends)
I'm not sure if this still works on the new Windows versions but try it out:
Code:
Set WSHShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\WINDOWS\system32\shutdown.exe -r -t 0
User Tools
Quote this message in a reply
04-28-2012, 07:46 PM (This post was last modified: 04-28-2012 07:46 PM by Doraemon.)
Post: #4
RE: Basic VBS Tutorial (Useful for trolling friends)
it is similar with visual basic...
if you know how to code in visual basic,
you should know this too

User Tools
Quote this message in a reply
04-28-2012, 09:02 PM
Post: #5
RE: Basic VBS Tutorial (Useful for trolling friends)
this thread can damage friend computer ?

im scare to try it... Sad
User Tools
Quote this message in a reply
04-28-2012, 09:54 PM
Post: #6
RE: Basic VBS Tutorial (Useful for trolling friends)
None of the scripts from above can damage your computer.
User Tools
Quote this message in a reply
04-28-2012, 11:05 PM
Post: #7
RE: Basic VBS Tutorial (Useful for trolling friends)
no i think is possible if this script can make our computer not started in normal.
User Tools
Quote this message in a reply
04-29-2012, 01:13 AM
Post: #8
RE: Basic VBS Tutorial (Useful for trolling friends)
They can't damage your computer, I repeat it a last time.

To stop your computer from booting normally someone must be so stupid to put the restart script into autostart....
User Tools
Quote this message in a reply
04-29-2012, 02:00 AM (This post was last modified: 04-29-2012 02:07 AM by Matthew425.)
Post: #9
RE: Basic VBS Tutorial (Useful for trolling friends)
It won't make your pc not start. But for the msgbox, i believe its soppose to be msgbox("Text Here").
You can also customize the msgbox with styles, like msgbox("Hello",MsgBoxStyle.Exclamation)
You can get the rest of the styles here: http://msdn.microsoft.com/en-us/library/...s.80).aspx
User Tools
Quote this message in a reply
04-29-2012, 03:28 AM
Post: #10
RE: Basic VBS Tutorial (Useful for trolling friends)
interesting, can you make it a service so most people won't know how to stop it?
User Tools
Quote this message in a reply
Post Reply 


Forum Jump:



User(s) browsing this thread:
1 Guest(s)