{
  "id": "enwiki-001351868680",
  "slug": "vbscript",
  "title": "VBScript",
  "qid": "",
  "lead": "VBScript (Microsoft Visual Basic Scripting Edition) is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM), based on classic Visual Basic and Active Scripting. It was popular with system administrators for managing computers and automating many aspects of computing environments, and has been installed by default in every desktop release of Microsoft Windows since Windows 98; in Windows Server since Windows NT 4.0 Option Pack; and optionally with Windows CE (depending on the device it is installed on). VBScript running environments include Windows Script Host (WSH), Internet Explorer (IE), and Internet Information Services (IIS). The running environment is embeddable in other programs via the Microsoft Script Control ( ). In October 2023, Microsoft announced that VBScript was deprecated. In May 2024, a multi-phase deprecation schedule was announced with disabling it by default \"around 2027\" and removing it sometime later.",
  "body": "VBScript (Microsoft Visual Basic Scripting Edition) is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM), based on classic Visual Basic and Active Scripting. It was popular with system administrators for managing computers and automating many aspects of computing environments, and has been installed by default in every desktop release of Microsoft Windows since Windows 98; in Windows Server since Windows NT 4.0 Option Pack; and optionally with Windows CE (depending on the device it is installed on). VBScript running environments include Windows Script Host (WSH), Internet Explorer (IE), and Internet Information Services (IIS). The running environment is embeddable in other programs via the Microsoft Script Control ( ). In October 2023, Microsoft announced that VBScript was deprecated. In May 2024, a multi-phase deprecation schedule was announced with disabling it by default \"around 2027\" and removing it sometime later. ==History== VBScript began as part of the Microsoft Windows Script Technologies, launched in 1996. This technology (which also included JScript) was initially targeted at web developers. During a period of just over two years, VBScript advanced from version 1.0 to 2.0, and over that time it gained support from Windows system administrators seeking an automation tool more powerful than the batch language first developed in the early 1980s. On August 1, 1996, Internet Explorer was released with features that included VBScript. In version 5.0, the functionality of VBScript was increased with new features including regular expressions; classes; the With statement; the Eval, Execute, and 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 version 5.5, SubMatches were added to the regular expression class in VBScript, to finally allow script authors to capture the text within the expression's groups. That capability had already been available in JScript. With the advent of the .NET Framework, the scripting team decided to implement future support for VBScript within ASP.NET for web development, and therefore no new versions of the VBScript engine would be developed. It would henceforth be supported by Microsoft's Sustaining Engineering Team, who are responsible for bug fixes and security enhancements. After announcing plans to remove support for VBScript, Microsoft suggested migrating to Windows PowerShell or JavaScript. ==Environments== ===Client-side web=== In a web page loaded by Internet Explorer, VBScript is similar in function to JavaScript. The VBScript code in the HTML is logic that interacts with the Document Object Model (DOM) of the page allowing for functionality not possible in HTML alone. However, other web browsers such as Chrome, Firefox and Opera do not support VBScript. Therefore, when client-side scripting and cross-browser compatibility are required, developers usually choose JavaScript due to its wide cross-browser compatibility. ===Active server page=== VBScript is used for server-side web page functionality via Active Server Pages (ASP). The ASP engine, , invokes to run VBScript scripts. VBScript that is embedded in an ASP page is contained within context switches. The following example displays the current time in 24-hour format. VBScript Example The time, in 24-hour format, is : : . ===Windows script host=== VBScript can run directly in the operating system via the Windows Script Host (WSH). A script file, usually with extension .vbs can be run either via for graphical user interface (GUI) or for command line interface (CLI). ===Windows script file=== A Windows Script File (WSF), styled after XML, can include multiple VBS files and is therefore a library of VBScript code that can be reused in a modular way. The files have extension .wsf and can be executed using or , as with a .vbs file. ===HTML Application=== An HTML Application (HTA) is styled after HTML. The HTML in the file is used to generate the user interface, and a scripting language such as VBScript is used for the program logic. The files have extension . and can be executed using . ===Windows Script Component=== VBScript can also be used in a Windows Script Component, an ActiveX-enabled script class that can be invoked by other COM-enabled applications. These files have extension . ==Functionality== ===Language features=== The VBScript language is modeled on classic Visual Basic. Notable features include: A \"procedure\" is the main construct in VBScript for separating code into smaller modules. VBScript distinguishes between a function, which can return a result in an assignment statement, and a subroutine, which cannot. Parameters are positional, and can be passed by value or by reference. Control structures include the usual iterative and conditional Do Loops, If-Then-Else statements, and Case statements, with some more complex variants, such as ElseIf and nested control structures. As a memory aid in coding, and certainly for readability, there are a large number of constants, such as and for logical values, and for codes, and for color values, for the carriage return character, and many others. Variables have \"Variant\" type by default, but it is possible (and sometimes necessary) to force a particular type (integer, date, etc.) using conversion functions ( , , etc.) User interaction is provided through the functions MsgBox and InputBox which provide a simple dialogue box format for messages and input. Both functions display prompting messages, with the former returning a standard response, and the latter returning one user-supplied text or numeric value. For more elaborate GUI interaction with controls, VBScript can be used in combination with HTML, for example, in an HTML Application. Event-driven forms are not supported as in Visual Basic or Visual Basic for Applications. Names are not case-sensitive. However, it is considered a best practice of VBScript style to be consistent and to capitalize judiciously. ===VBScript functionalities=== When hosted by the Windows Script Host, VBScript provides numerous features which are common to scripting languages, but not available from Visual Basic 6.0. These features include: Named and unnamed command line arguments Stdin and stdout, which could be redirected WSH.Echo which writes to the console and cannot be redirected WSH.ExitCode which can be tested from DOS batch files, or by the process which invoked the script file Network printers Network shares Special folders, e.g. Desktop, Favorites, MyDocuments and so on Network user information, such as group membership Methods for runtime execution of text defined at runtime: Eval and Execute Methods for executing scripts on remote machines Windows Management Instrumentation (WMI) Functionality for embedding a VBScript engine in other applications, using a widely known language CScript, the command line runner, provides options for: Interactive or batch mode Invoking debug mode from the command line Error reporting including the line number ==Development tools== Microsoft does not routinely make available an IDE (Integrated Development Environment) for VBScript, although the Microsoft Script Editor has been bundled with certain versions of Microsoft Office. For debugging purposes the Microsoft Script Debugger can still be used in current Windows versions, even though the tool has not been updated in years. It allows the user to set break points in the VBScript code but the user interface is more than clumsy. There are VBScript debuggers available from third-party sources, and many text editors offer syntax highlighting for the language. During execution, when an error occurs, the script host issues a message stating the type of error and the number of the offending line. ==See also== AppleScript FastTrack Scripting Host HTML Components JavaScript JScript .NET JScript PerlScript Windows PowerShell Windows Script File ==References== ==External links== VBScript Language Reference, Microsoft Docs Is VBScript Dead?, isvbscriptdead.com VBScript Commands, ss64.com VBScript How-to guides and examples, ss64.com WMI Overview, Microsoft TechNet",
  "categories": [
    "20326374",
    "20360951",
    "22962102",
    "22994333",
    "23118434",
    "23603337",
    "24745122",
    "27515961",
    "28269683",
    "3469202",
    "90990102"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1351868680",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1777561851.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001351868680",
    "type": "webpage",
    "title": "VBScript",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/vbscript",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          18
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          18
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001351868680",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1351868680",
    "note": "Immutable snapshot enwiki-001351868680"
  }
}