I learn it from websites you'll learn it from me =D
So lets get started ...
What is vbs?
VBScript is a Microsoft scripting language. -_- so being Microsoft they go and make it so it only works on IE. But as well as being a web script it is used for all kinds of things ...
for example on pic 2) (that's the second pic) That is take from the System 32 folder. Vbs can also be used to make programs .. but that's VB.NET .. uses most of the same coding though.
Please enjoy the tutorial .. and please comment and rate.
And please tell me if someone has beet me to making a vbs tutorial .. but i couldn't find one.
Other than cammel8 who seems to be really good with vbs scripting =P .. but i'm still gonna make the tutorial.
Remove these ads by
Signing UpStep 1Basics of vbs
You save the files as: something.vbs
It's not like a batch file it doesn't have a screen telling you information.
In a way it's much like javascript. But at the same time it's nothing like it.
to make a var you use dim
e.g .. dim iRule
now you would have a variable call iRule
now you can start to add things to you vars .. like:
iRule=msgbox("hello")
this would make a message box pop up saying hello. (pic 1)
Along with that you can add different buttons to the message box ..
here is all about message boxes: HERE
so many tutorials on them that i won't even bother to go into them.
Also with vars you can dim vars in an array:
dim iRule(3)
but that would turn out like this: (because 0 is included)
iRule(0)="var1"
iRule(1)="var2"
iRule(2)="var3"
iRule(3)="var4"
Using vars in the script..
You can use vars easily ..
you could have: (pic 2)
dim iRule
dim instructables
iRule="instructables"
instructables=msgbox("hello " & iRule)
Because of the & it says 'hello instructables' becuse the value of iRule is instructables.
Subs
You can also have subs:
A sub is a procedure that does NOT give a return value.
Sub iRule(arg1,arg2,arg3)
...Script...
End Sub
The arg 1,2,3 are the Arguments.
That about all of the basics .. enjoy them .. or keep reading for not so basics..
| « Previous Step | Download PDFView All Steps | Next Step » |













































(Because in vb6 it is in var AppPath)
if you want a path can't you just type it in without the app.path ?
then again I've never used VB6 so I'm still not sure what app.path does.
because that script is 'frozing' a computer and works like this:
Set x = CreateObject(Wscript.Shell)
x.Run way where is script saved
Do
Loop 'looping forever - forzing
do
set x = CreateObject("WScript.Shell")
x.run "lol.bat"
loop
that's if you have a bat file named lol
@echo off
:1
1.bat
goto :1
assuming the batch file is called 1.bat
im 13 and i know this i thoght someone would have thoght of that LOL
Batch file:
s:
start "Forze.vbs"
goto s
in same folder vbscript:
Do
Loop
OR
For i = 1 To 3
i = 2
Next i
a=InputBox("Do you like Cheesecake?:","Var")
if var=yes then
msgbox ("YAY! I like cheesecake too!")
if var=no then
msgbox ("Aww..... You suck. Cheesecake is the best!")
It's probably something obvious.
..........
dim a
a=InputBox("Do you like Cheesecake?:","title")
if a=("yes") Then
msgbox("YAY! I like cheesecake too!")
elseif a=("no") Then
msgbox("Aww..... You suck. Cheesecake is the best!")
else
msgbox("Enter yes or no!")
End If
..........
hope it helped, sorry for the slow reply.
A great tutorial
btw, can you send me the code of the batch notepad i modified for you? I recently upgraded to a better pc and lost the file
thx
do
wscript.sleep 200
wshshell.sendkeys "{NUMLOCK}"
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wscript.sleep 100
wshshell.sendkeys "{sCROLLLOCK}"
wscript.sleep 200
wshshell.sendkeys "{sCROLLLOCK}"
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wscript.sleep 100
wshshell.sendkeys "{NUMLOCK}"
loop
turn off numlock and run that
LED Loader
so what do you want it to do?
Set sh = CreateObject("WScript.Shell")
Set shortcut = sh.CreateShortcut("shortcut.lnk")
shortcut.TargetPath = "C:\where eva"
shortcut.Save
e.g: shortcut.TargetPath = "C:\folder\test.vbs"
the get object is used for certain functions:
example
different scripts need to call different functions.
e.g the CreateObject("SAPI.SpVoice") is used to make the pc talk.
Set objShell = CreateObject("Wscript.Shell")
msg = Msgbox("Press yes to say hello.",36, "Hello?")
If msg = vbYes Then
msgbox("Hello =]")
Else
Wscript.Quit
End If
Says hello if you press yes
Quits if you press no
Does nothing if you press the X .. so you have to answer =]
Also: LINK - will help
btw its : dont need the top line of old 1
msg = Msgbox("Press yes to say hello.",36, "Hello?")
If msg = vbYes Then
msgbox("Hello =]")
Else
Wscript.Quit
End If