1. Introduction
The PDF of this document is available |HERE|.
The purpose of this document is to provide an introduction to the VBScript language, along with examples of its use in various fields. VBScript is a scripting language for Windows. It can run in various environments, such as
- Windows Scripting Host for direct use in Windows, particularly for writing system administration scripts
- Internet Explorer. It is then used within HTML pages, adding a level of interactivity that cannot be achieved with HTML alone.
- Internet Information Server (IIS), Microsoft’s web server on NT/2000, and its equivalent, Personal Web Server (PWS), on Win9x. In this case, VBScript is used for server-side web programming, a technology referred to by Microsoft as ASP (Active Server Pages).
Furthermore, since VBScript is a language derived from Visual Basic for Windows, it can serve as an introduction to this language—one of the most widely used in the Windows environment—as well as to the application version of VB, known as VBA (Visual Basic for Applications). VBA is used, for example, throughout the Microsoft Office suite, particularly in Excel. Thus, VBScript serves as a gateway to development across a wide range of Windows applications.
VBScript is not an object-oriented language, even though it has some object-oriented features. The concept of inheritance, for example, does not exist. However, it can use the objects made available to it by the container in which it runs, as well as, more generally, the ActiveX components available on the Windows machine. It is this aspect that gives VBScript its power; a language that is intrinsically quite limited but which, thanks to the objects made available to it, can rival scripting languages that are initially richer, such as Perl, JavaScript, and Python. It is a language that is simple to learn and use, and which paves the way for the use of Visual Basic for Windows, from which it is directly derived.
This document is not a course in algorithms. The art of programming is assumed to be mastered. Active reading is required. The best way to use this document is probably to test the examples provided here on your own machine. The WSH container is normally included as standard with the Windows operating system. The most recent version is available for free on the Microsoft website (http://www.microsoft.com). To find the exact URL for downloading WSH, you can search for the keywords "Windows Scripting" using a web search engine. Among the results, you should find the WSH download URL.
Serge Tahé, January 2002