VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft. Active Scripting (formerly known as ActiveX Scripting) is the technology used in Windows to implement component-based scripting support Microsoft Corporation is an American multinational Computer technology Corporation, which rose to dominate the Home computer The language's syntax reflects its pedigree as a limited variation of Microsoft's Visual Basic programming language. Visual Basic ( VB) is the third-generation event-driven programming language and associated development environment (IDE from VBScript is installed by default in every desktop release of the Windows Operating System (OS) since Windows 98[1] and may or may not be included with Windows CE depending on the configuration and purpose of the device it is running on. Windows 98 ( codenamed Memphis) is a graphical Operating system released on 25 June 1998 by Microsoft and the successor to Windows 95 Windows CE (also known officially as Windows Embedded Compact post version 6 It initially gained support from Windows administrators seeking an automation tool more powerful than the batch language first developed in the late 1970s. In DOS, OS/2, and Microsoft Windows, a batch file is a Text file containing a series of commands intended to be executed by the A VBScript script must be executed within a host environment, of which there are several provided on a standard install of Microsoft Windows (Windows Script Host, Windows Internet Explorer). The Microsoft Windows Script Host (originally called Windows Scripting Host, but renamed for the second release is distributed and installed by default on Windows Windows Internet Explorer (formerly Microsoft Internet Explorer abbreviated MSIE) commonly abbreviated to IE, is a series of graphical Additionally, The VBScript hosting environment is embeddable in other programs, through technologies such as the Microsoft Script control (msscript. ocx).
Contents |
VBScript began as part of the Microsoft Windows Script Technologies, which were targeted at web developers initially and were launched in 1996. During a period of just over two years, the VBScript and JScript languages advanced from version 1. 0 to 2. 0 (the latter later renamed 5. 0) and over that time system administrators noticed it and began using it. In version 5. 0, the functionality of VBScript was increased with new features such as regular expressions, classes, the With statement,[2] Eval/Execute/ExecuteGlobal functions to evaluate and execute script commands built during the execution of another script, a function-pointer system via GetRef(), and Distributed COM (DCOM) support. In Computing, regular expressions provide a concise and flexible means for identifying strings of text of interest such as particular characters words or patterns of characters In Object-oriented programming, a class is a Programming language construct that is used as a blueprint to create objects This blueprint includes attributes
In 5. 5, "Submatches"[3] were added to the regular expression class in VBScript to finally allow VBScript script authors to capture the text within the expression's groups. In Computing, regular expressions provide a concise and flexible means for identifying strings of text of interest such as particular characters words or patterns of characters That capability before was only possible through the JScript member of the Microsoft ActiveX Scripting family.
As of 2007, no new functionality will be added to the VBScript language, which has been superseded by Windows Powershell. Windows PowerShell is an extensible command-line shell and associated Scripting language from Microsoft However, it will continue to be shipped with future releases of Microsoft Windows, as will other components of the ActiveX Scripting Family (such as JScript). JScript is the Microsoft dialect of the ECMAScript Scripting language specification Additionally, support will continue due to the amount of code written in it and because it is still considered a useful tool for some tasks.
The language engine is currently being maintained by Microsoft's Sustaining Engineering Team, which is responsible for bug fixes and security enhancements.
When employed in Microsoft Internet Explorer, VBScript is 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. Windows Internet Explorer (formerly Microsoft Internet Explorer abbreviated MSIE) commonly abbreviated to IE, is a series of graphical JavaScript is a Scripting language most often used for Client-side web development The Document Object Model ( DOM) is a platform- and language -independent standard Object model for representing HTML or XML and related Other web browsers such as Firefox, and Opera do not have built-in support for VBScript. Opera is a Web browser and Internet suite developed by the Opera Software company This means that where client-side script is required on a web site, developers almost always use JavaScript for cross-browser compatibility.
Besides client-side web development, VBScript is used for server-side processing of web pages, most notably with Microsoft Active Server Pages (ASP). Active Server Pages ( ASP) is Microsoft 's first server-side script engine for dynamically-generated web pages The ASP engine and type library, asp. dll, invokes vbscript. dll to run VBScript scripts. VBScript that is embedded in an ASP page is contained within <% and %> context switches. The following example of an ASP page with VBScript displays the current time in military format (Note that an '=' sign occurring after a context switch (<%) is short-hand for a call to Write() method of the Response object).
<% Option Explicit %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4. 01 Transitional//EN" "http://www. w3. org/TR/html4/loose. dtd"> <html> <head> <title>VBScript Example</title> </head> <body><% 'Grab current time from Now() function. Dim timeValue timeValue = Now %> The time, in military format, is <%=Hour(timeValue)%>:<%=Minute(timeValue)%>:<%=Second(timeValue)%>. </body> </html>
VBScript can also be used to create applications that run directly on a person's computer running Microsoft Windows. Microsoft Windows is a series of Software Operating systems and Graphical user interfaces produced by Microsoft. The simplest example of this is a script that makes use of the Windows Script Host (WSH) environment. The Microsoft Windows Script Host (originally called Windows Scripting Host, but renamed for the second release is distributed and installed by default on Windows 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.
VBScript . vbs files can be included in two other types of scripting files: . wsf files, which are styled after XML; and . hta files, which are styled after HTML. . wsf files can be executed using wscript. exe or cscript. exe, just like . vbs files, and . wsf files can include multiple . vbs files. As a result . wsf files provide a means for code reuse: one can write a library of classes or functions in one or more . vbs files, and include those files in one or more . wsf files to use and reuse that functionality in a modular way.
Another employment of VBScript is the HTML Application, or HTA (file extension . An HTML Application (HTA is a Microsoft Windows application written with HTML and Dynamic HTML. A filename extension is a suffix to the name of a Computer file applied to indicate the encoding convention ( File format) of its contents hta). In an HTA, HTML is used for the user interface, and a scripting language such as VBScript is used for the program logic. HTAs run inside of mshta. exe, which is a 'Trusted Application Environment' provided by Internet Explorer. Windows Internet Explorer (formerly Microsoft Internet Explorer abbreviated MSIE) commonly abbreviated to IE, is a series of graphical The 'Trusted Application Environment', implies that HTAs do not suffer the restrictions applied to applications running in the web or intranet zone, such as accessing local files or network paths. Although HTAs run in this 'trusted' environment, querying Active Directory can be subject to Internet Explorer Zone logic and associated error messages. Active Directory ( AD) is a technology created by Microsoft that provides a variety of network services including LDAP -like Directory Windows Internet Explorer (formerly Microsoft Internet Explorer abbreviated MSIE) commonly abbreviated to IE, is a series of graphical
Lastly, VBScript (and JScript) can be used in a . wsc file to create a Windows Script Component - an ActiveX-enabled script class that can be invoked by other COM-enabled applications. Component Object Model ( COM) is an interface standard for Software componentry introduced by Microsoft in 1993 [4]
As-is, VBScript provides functions and sub-routines, basic date/time, string manipulation, math, user interaction, error handling, and regular expressions. Additional functionality can be added through the use of ActiveX technologies. File system management, file modification, and streaming text operations can be achieved with the Scripting Runtime Library scrrun. dll. Binary file and memory I/O is provided by the "ADODB. Stream" class, which can also be used as a string builder (since a high amount of VBScript string concatenation is costly due to constant memory re-allocation), and can be used to convert an array of bytes to a string and vice versa. Database access is made possible through ActiveX Data Objects (ADO), and the IIS Metabase can be manipulated using the GetObject() function with sufficient permissions (useful for creating and destroying sites and virtual directories). Microsoft's ActiveX Data Objects ( ADO) is a set of Component Object Model (COM objects for accessing data sources MetaBase is a user contributed Database of Biological databases, listing all the biological databases currently available on the Internet Additionally, XML files and schemas can be manipulated with the Microsoft XML Library Application Programming Interfaces (msxml6. Microsoft XML Core Services ( MSXML) is a set of services that allow applications written in JScript, VBScript, and Microsoft development tools to build dll, msxml3. dll), which also can be used to retrieve content from the World Wide Web via the XMLHTTP and ServerXMLHTTP objects (class strings "MSXML2. XMLHTTP. 6. 0" and "MSXML2. ServerXMLHTTP. 6. 0").