VB SCRIPT
Introduction:-
VB Script (Visual Basic Scripting):- is an Active Scripting language developed by Microsoft
that is modelled on Visual Basic. It is designed as a “lightweight” language with a fast interpreter
for use in a wide variety of Microsoft environments. VBScript uses the Component Object
Model to access elements of the environment within which it is running; for example, the
FileSystemObject (FSO) is used to create, read, update and delete files.
VBScript has been installed by default in every desktop release of Microsoft Windows since
Windows 98;
• From now onward use vbs for vb script
• Vbs use only one data type i.e variant. The data type such as
integer,long,single,double,array,object etcare the subtypes of
variant(Master type)
• The vbs is used mainly to activate web pages.
• Vbs works in the interpreter manner so it does not require any
compiler.
• Msg function is used to get output.
NOTE:- A VBScript script must be executed within a host environment, of
which there are several provided with Microsoft Windows, including:
Windows Script Host (WSH), Internet Explorer (IE), and Internet Information
Services (IIS).[3] Additionally, the VBScript hosting environment is
embeddable in other programs, through technologies such as the Microsoft
Script Control (msscript.ocx).
Syntax:-
Msgbox(prompt) --- any predefined function in vbs
isnot case sensitive
Msgbox”welcome to vbs”
How to substitute a variable
Val=”Bangalore”
Msgbox”My native place is “&val
& is used to concatenate with the sentence and also to substitute the
variable
To substitute the variable
val="bangalore"
msgbox val //replacing variable//
Display multiple line in a single message box.
NOTE:-for new line we will use Vbnewline
e.g
msgbox”it is abook”&vbnewline&”
“It is a on atable