VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language
developed by Microsoft. The language's syntax reflects its pedigree as a variation
of Microsoft's Visual Basic programming language. VBScript is installed as default
in every Windows OS since Windows 98. It initially gained support from Windows administrators
seeking an automation tool more powerful than the batch language first developed
in the late 1970s. A VBScript script must be executed within a host environment,
of which there are several.
When employed in Microsoft Internet Explorer, VBScript is very similar in function
to JavaScript, as a language to write functions that are embedded in or included
from HTML pages and interact with the Document Object Model (DOM) of the page, to
perform tasks not possible in HTML alone. Other web browsers such as Firefox and
Opera do not typically have built-in support for VBScript. This means that where
client-side script is required on a web site, developers generally use JavaScript
for better browser compatibility, since Internet Explorer also has an implementation
of JavaScript (known as JScript – J#).
Besides client-side web development, VBScript can be used for server-side processing
of web pages, mostly notably with Microsoft Active Server Pages (ASP). The ASP engine
asp.dll invokes vbscript.dll to run VBScript scripts. VBScript that is embedded
in an ASP page is contained within
<% and %> tags. The following example of an ASP page with VBScript displays the current time.
VBScript can also be used to create applications that run directly on a person's
computer running Microsoft Windows. One way is through a combination of VBScript
and HTML called an HTML Application (file extension .hta). In an HTA, HTML is used
for the user interface, and a scripting language such as VBScript is used for the
program logic.
Another way is a script written in VBScript and executed within the Windows Script
Host (WSH) environment. Such a script is usually in a stand-alone file with the
file extension .vbs. The script can be invoked in two ways. Wscript.exe is used
to display output and receive input in through a GUI, such as dialog and input boxes.
Cscript.exe is used in a command-line environment.