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!
- Visual Basic Scripting Edition (VBScript)
- 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.
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 –
- Visual Basic Language
- Visual Basic for Applications (VBA) and
- 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 –
- ‘Interpreted at Runtime’
- Requires a ‘Host‘ to run on windows and
- 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’.