VBS Part 1 – Introduction and Background

At the upfront, this theoretical article might look boring to most of us but still, it is advisable to know about our scripting friend before we start interacting and dealing with it. This is to provide a brief background of VBS, its purpose, origin etc., and if we don’t let go our patience it does turn out to be interesting! In this article, we would briefly discuss about – ‘Windows Script’, ‘Microsoft Visual Basic Family’, ‘VBScript’ background, history and versions.

To start with, the commonly referred to as ‘VB Script’ was developed by Microsoft and hence officially known as the ‘Microsoft’s Visual Basic Scripting Edition‘. It is one of the important members of the ‘Windows Script Technology’ which consists of a total of two members.

Windows Script Technology

The ‘Windows Script‘ is the technology which is the backbone of scripting on Windows platform. It has been manifested as two ‘Script Engines’. Although it is not recommended because of the resulting complexity but these two scripting languages can be included in parallel within a single project and should work perfectly fine!

Windows Script Engines
  1. Visual Basic Scripting Edition (VBScript)
  2. Microsoft JScript

Under this ‘Windows Script banner, Microsoft provides an array of supporting features and technologies which includes tools like – debuggers, script encoders besides the COM libraries and object models like – Runtime Library (scrrun.dll), WSH, WMI, ADSI, DOM and many more.

blank

We will discuss more about ‘VBScript’ in this article as well as in subsequent posts, but for ‘JScript’ we will put an end by saying that it is  Microsoft’s implementation of ‘ECMA Scripting Standards and Specification‘. For reference the Netscape’s ‘JavaScript’ as well is an implementation of the same ECMA specification and hence there is a common misconception that both JScript and JavaScript are same but officially it might be wrong to say that.

The Microsoft VB Family

The ‘VBScript’ belongs to the Microsoft VB family, more precisely it is a subset of the ‘Microsoft’s Visual Basic Language‘, this is quite obvious when we look at the similarties in the syntax of the both. The VB family comprises of three members –

VB Family Members
  1. Visual Basic Language
  2. Visual Basic for Applications (VBA) and
  3. Visual Basic Scripting Edition (VBScript)

Unlike the rest of the two members, the VBScript is typically a ‘scripting language hence it inherits all the features and constraints of a ‘scripting language’. Since the VB and VBA are not in-scope of this article hence rather than ‘muddying the water’, we would restrict ourselves to VBScript.  As with any scripting language VBScript is –

Windows Script Engines
  1. Interpreted at Runtime’
  2. Requires a Host to run on windows and
  3. Does not support Early Binding

Besides the above, it is a Loosely Typed Language which means it uses a ‘universal data‘ type (variant) and does not constraints the programmer to specify data types for variables while scripting. You can find more details and explanation on the above in related sections.

History and Background

Historically, VBScript was probably first released (version 1.0) and shipped with Internet Explorer (MSIE 3.0) in 1996. It was intended to be used by web-developers to enhance their ‘client-side scripting’ capabilities.

Nearly a year after, VBScript (version 2.0) was released with some added server-side scripting’ capabilities for Internet Information Server (IIS) which was quite well leveraged with ASP. It was since then, that VBScript quickly claimed its right place. With this success, VBScript (version 3.0) was quickly introduced in Outlook 98 and for the first time appeared with ‘Windows Script Host‘ (WSH 1.0).

Together with  ‘Windows Script Host(WSH) which supported any ‘ActiveX Scripting‘ languages, VBScript proved a  boon to system administrators by providing the capability to manage and control system resources via VBScripts and other ‘ActiveX scripting‘ languages.

Besides all this, VBScript still lacked any native ‘Object Model‘ and hence soon after, it was supplemented with a ‘Runtime Library‘ providing some ‘Object Model‘. This ‘Script Runtime Library‘ was implemented as ‘scrrun.dll‘ which primarily introduced ‘Dictionary‘ and ‘Filesystem (FSO) object models’.

During the early launch days of VBScript, it had to face a tough competition with another scripting language that preceded it – ‘JavaScript’. Moreover unlike VBScript the ‘Netscape’s‘ support for ‘JavaScript‘ did boost the acceptance of ‘JavaScript‘ in the market rather then VBScript. But due to Microsoft’s committment towards VBScript and subsequent inclusion of VBScript in number of Microsoft products like – IIS, Internet Explorer, Outlook and WSH made VBScript to survive the competition till date.

Latest and Significant Versions

Over the years because of Microsoft’s commitment to VBScript, there have been considerable releases of VBScript each of them adding more or less to it’s feature set. You can find detailed information about VBscript versions on this page on MSDN.

The latest version of VBScript available at the time of this article (Sept 2009) is VBScript version 5.8 available with Internet Explorer v8. However if you ask me the most significant release still remains the VBScript version 5.0. Since it was this VBScript version 5.0 in which Microsoft introduced the – ‘Class Objects’, ‘Class Statement’, ‘Property Let, Get and Set’, ‘Regular Expressions’, ‘Events’, Timer‘, etc.

Applied VBScript (The Playground)

As described above VBScript was meant to be client-side scripting‘ language which holds true to the good extent till date besides its capabilities and usage in server-side scripting in conjunction with HTML, ASP or others. The ‘.HTC’ files being the most basic example of webpage and VBScript collaboration.

Apart from this web arena, VBScript is predominantly popular in ‘system administration‘ domain and of course proves as a good aid in related ‘system side development’ wherein it fits very well along with WSH, WMI, ADSI, ADO etc.

Moreover, to add to its importance and usage – The latest playground is of course HP’s ‘Quick Test Pro‘ which has considerably raised the popularity of VBScript among the ‘Software Testing Community’.

Tushar Sharma
Tushar Sharmahttps://www.automationdojos.com
Hi! This is Tushar, the author of 'Automation Dojos'. A passionate IT professional with a big appetite for learning, I enjoy technical content creation and curation. Hope you are having a good time! Don't forget to subscribe and stay in touch. Wishing you happy learning!

2 COMMENTS

  1. Ridicule is generally made use of to laugh men out of virtue and good sense, by attacking everything praiseworthy in human life. Do you think so?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

VBSCRIPT TUTORIALS

Recent Posts

RELATED POSTS

How To Load XML File into DOM Using MSXML

Microsoft XML Core Services (MSXML) provides two methods for loading XML documents into the Document Object Model (DOM) and one method and one property...

Early Bound Vs Late Bound (Binding)

What is Binding Before we dive into 'Early' and 'Late' stuff, let us discover, what the 'Binding' itself means? In simple terms, the 'Binding' refers to...

Finding Web Elements with Selenium

I'm going to explain in this tutorial about the usage of the findElement and findElements method of Selenium Webdriver on the Chrome web browser....

How To Write Windows Environment Variables With VBScript

This is in continuation to the last post where we saw how to read windows environment variables using VBScript. As mentioned in the last...

Â

CHECKOUT 'HOW-TOs'

How To Install Oh-My-Posh On Windows PowerShell

Oh-My-Posh is a powerful custom prompt engine for any shell that has the ability to adjust the prompt string...

MORE ON CODEX

MORE IN THIS CATEGORY

Java Tutorial #2 – Operators in Java

Table of Contents Introduction 1. Assignment Operator 2. Arithmetic Operators 3. Compound Operators 4. Increment & Decrement Operators 5. Relational Operators 6. Logical Operators Introduction Operators are an essential...

How To Remove Duplicates From List in Java

Introduction A List is an interface in the Java collection framework which can be used to store a group of objects. A List is ordered...

Does VBScript Supports all COM Objects ?

Well the answer in one line is - No VBScript does not supports all COM Objects or Servers! VBScript works with only a subset of ‘Objects’...

How To Create Maven Project in Eclipse With Archetype

Maven Basics Maven automates the steps involved in building a software application like adding the JAR files, compiling code, running unit tests, creating the output...

OTHER TUTORIALS

How To Do Database Testing with JMeter

Introduction In this 'How-To', You will be guided to perform a database load test using JMeter. We will be installing...

Java DecimalFormat Class

- Advertisement -spot_img