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 Auto-launch VBscript with Elevated Privileges

For cases when you need to execute a VBS script (*.vbs file) as admin with elevated privileges you can try the following snippet. This...

How To Convert String To Date in Java

Introduction There are often scenarios in programming, where you will need to convert a date in String format to an actual Date object. For example,...

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....

VBS Part 2 – Fundamentals and Concepts

Having gone through the Introductory part, it is time to look at some crucial fundamentals and concepts. This article is to refresh some of...

Â

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

Concatenate Strings Using String.join()

Java 8 has added a static join method to the String class. This concatenates Strings using a delimiter. Performance wise, it is similar to...

Working with JMeter Listeners

About Listeners Listeners are used for displaying test results in JMeter. Listeners allow system engineers to analyze the responses from the testing system and monetize...

Format Decimal Numbers Using Pattern

The java.text.DecimalFormat class is used to format numbers using a user specified formatting. This concrete subclass of NumberFormat, allows formatting decimal numbers via predefined...

Convert List to Array Using For-Loop

The simplest way to convert a List to an array is to use a for-loop. The following code snippet demonstrates this method. First, the code...

OTHER TUTORIALS

A Brief Review Of WATIR

WATIR stands for 'Web Testing Application in Ruby'. It is an OLE-based testing application that automates your browser using...
- Advertisement -spot_img