The Microsoft Windows Script Host ( WSH ) (formerly named Windows Scripting Host ) is an automation technology for Microsoft Windows operating systems that provides scripting abilities comparable to batch files , but with a wider range of supported features. This tool was first provided on Windows 95 after Build 950a on the installation discs as an optional installation configurable and installable by means of the Control Panel , and then a standard component of Windows 98 (Build 1111) and subsequent and Windows NT 4.0 Build 1381 and by means of Service Pack 4. The WSH is also a means of automation for Internet Explorer via the installed WSH engines from IE Version 3.0 onwards; at this time VBScript became means of automation for Microsoft Outlook 97. The WSH is also an optional install provided with a VBScript and JScript engine for Windows CE 3.0 and following and some third-party engines including Rexx and other forms of Basic are also available.
43-541: WSH may refer to: Windows Script Host , in computing World Series Hockey , a hockey tournament Sports teams based in Washington, DC, US: Washington Commanders , American football Washington Wizards , basketball Washington Nationals , baseball Washington Capitals , hockey Western Steppe Herders , a hypothesised ancient people Traverse City West Senior High School , Michigan, US Topics referred to by
86-411: A Component Object Model (COM) automation server for dynamic or realtime financial or scientific data. As with any common programming language, VBA macros can be created with malicious intent. Using VBA, most of the security features lie in the hands of the user, not the author. The VBA host application options are accessible to the user. The user who runs any document containing VBA macros can preset
129-410: A Microsoft Word report from Microsoft Excel data that Excel collects automatically from polled sensors. VBA can use, but not create, ActiveX/COM DLLs, and later versions add support for class modules. VBA is built into most Microsoft Office applications, including Office for Mac OS X (except version 2008), and other Microsoft applications, including Microsoft MapPoint and Microsoft Visio . VBA
172-527: A Word document or sends them as an Outlook email. VBA programs can be attached to a menu button, a macro , a keyboard shortcut , or an OLE/COM event, such as the opening of a document in the application. The language provides a user interface in the form of UserForms, which can host ActiveX controls for added functionality. Inter-process communication automation includes the Dynamic Data Exchange (DDE) and RealTimeData (RTD) which allows calling
215-550: A message with an 'OK' button. Upon launching this script the CScript or WScript engine would be called and the runtime environment provided. Content of a file hello0.vbs WSH programming can also use the JScript language. Content of a file hello1.js Or, code can be mixed in one WSF file, such as VBScript and JScript , or any other: Content of a file hello2.wsf Windows applications and processes may be automated using
258-573: A script in Windows Script Host. Viruses and malware could be written to exploit this ability. Thus, some suggest disabling it for security reasons. Alternatively, antivirus programs may offer features to control .vbs and other scripts which run in the WSH environment. Since version 5.6 of WSH, scripts can be digitally signed programmatically using the Scripting.Signer object in a script itself, provided
301-857: A script with multiple languages in it in files with a .wsh extension. Extended Html and XML also add to the additional possibilities when working with scripts for network use, as do Active Server Pages and so forth. Moreover, Windows shell scripts and scripts written in shells with enhanced capabilities like TCC , 4NT , etc. and Unix shells under interoperability software like the MKS Toolkit can have scripts embedded in them as well. There have been suggestions of creating engines for other languages, such as LotusScript , SaxBasic , BasicScript , KiXtart , awk , bash , csh and other Unix shells, 4NT , cmd.exe (the Windows NT shell), Windows PowerShell , DCL , C , C++ , Fortran and others. The XLNT language
344-408: A text editor; the file extensions for these encoded scripts is .vbe and .jse and others of that type. Unless otherwise specified, any WSH scripting engine can be used with the various Windows server software packages to provide CGI scripting. The current versions of the default WSH engines and all or most of the third-party engines have socket abilities as well; as a CGI script or otherwise, PerlScript
387-468: A trusted publisher, thus preventing the execution of untrusted scripts. Note : By definition, all of these scripting engines can be utilised in CGI programming under Windows with any number of programmes and set up, meaning that the source code files for a script used on a server for CGI purposes could bear other file extensions such as .cgi and so on. The aforementioned ability of the Windows Script Host to run
430-465: A valid certificate is present on the system. Alternatively, the signcode tool from the Platform SDK, which has been extended to support WSH filetypes, may be used at the command line. By using Software Restriction Policies introduced with Windows XP, a system may be configured to execute only those scripts which are stored in trusted locations, have a known MD5 hash, or have been digitally signed by
473-451: Is also implemented, at least partially, in applications published by companies other than Microsoft, including ArcGIS , AutoCAD , Collabora Online , CorelDraw , Kingsoft Office , LibreOffice , SolidWorks , WordPerfect , and UNICOM System Architect (which supports VBA 7.1). Code written in VBA is compiled to Microsoft P-Code (pseudo-code), a proprietary intermediate language , which
SECTION 10
#1732858105752516-420: Is also installed if Internet Explorer 5 (or a later version) is installed. Beginning with Windows 2000 , the Windows Script Host became available for use with user login scripts. Windows Script Host may be used for a variety of purposes, including logon scripts, administration and general automation. Microsoft describes it as an administration tool . WSH provides an environment for scripts to run – it invokes
559-535: Is an implementation of Microsoft 's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supported or updated by Microsoft (except under Microsoft's "It Just Works" support which is for the full lifetime of supported Windows versions, including Windows 10 and Windows 11), the VBA implementation in Office continues to be updated to support new Office features. VBA
602-492: Is based on DCL and provides a very large subset of the language along with additional commands and statements and the software can be used in three ways: the WSH engine (*.xcs), the console interpreter (*.xlnt) and as a server and client side CGI engine (*.xgi). When a server implementing CGI such as the Windows Internet Information Server, ports of Apache and others, all or most of the engines can be used;
645-553: Is different from Wikidata All article disambiguation pages All disambiguation pages Windows Script Host It is language-independent in that it can make use of different Active Scripting language engines. By default, it interprets and runs plain-text JScript (.JS and .JSE files) and VBScript (.VBS and .VBE files). Users can install different scripting engines to enable them to script in other languages, for instance PerlScript . The language-independent filename extension WSF can also be used. The advantage of
688-540: Is downloadable for Windows 2000, Windows XP and Windows Server 2003. Recently , redistributable versions for older operating systems (Windows 9x and Windows NT 4.0) are no longer available from the Microsoft Download Center. Since Windows XP Service Pack 3, release 5.7 is the only version available from Microsoft, with newer revisions being included in newer versions of Windows since. Visual Basic for Applications Visual Basic for Applications ( VBA )
731-554: Is proprietary to Microsoft and, apart from the COM interface, is not an open standard . Interaction with the host application uses OLE Automation . Typically, the host application provides a type library and application programming interface (API) documentation which document how VBA programs can interact with the application. This documentation can be examined from inside the VBA development environment using its Object Browser. Visual Basic for Applications programs which are written to use
774-400: Is supplied with the programme, and alternate Rexx interpreters can be specified in the configuration of the programme. The MKS Toolkit provides PScript, a WSH engine in addition to the standard Perl interpreter perl.exe which comes with the package. VBScript, JScript, and some third-party engines have the ability to create and execute scripts in an encoded format which prevents editing with
817-454: Is the choice of many programmers for this purpose and the VBScript and various Rexx-based engines are also rated as sufficiently powerful in connectivity and text-processing abilities to also be useful. This also goes for file access and processing—the earliest WSH engines for VBScript and JScript do not since the base language did not, whilst PerlScript, ooRexxScript, and the others have this from
860-449: Is used for all components. Other components use Visual Basic for Applications . OpenOffice uses Visual Basic, Python, and several others as macro languages and others can be added. LotusScript is very closely related to VBA and used for Lotus Notes and Lotus SmartSuite , which includes Lotus Word Pro (the current descendant of Ami Pro ), Lotus Approach , Lotus FastSite , Lotus 1-2-3 , &c, and pure VBA, licensed from Microsoft,
903-536: Is used for professional and end-user development due to its perceived ease-of-use, Office's vast installed userbase, and extensive legacy in business. Visual Basic for Applications enables building user-defined functions (UDFs), automating processes and accessing Windows API and other low-level functionality through dynamic-link libraries (DLLs). It supersedes and expands on the abilities of earlier application-specific macro programming languages such as Word's WordBASIC . It can be used to control many aspects of
SECTION 20
#1732858105752946-556: Is used in Corel products such as WordPerfect , Paradox , Quattro Pro &c. Any scripting language installed under Windows can be accessed by external means of PerlScript, PythonScript, VBScript and the other engines available can be used to access databases (Lotus Notes, Microsoft Access, Oracle Database , Paradox) and spreadsheets (Microsoft Excel, Lotus 1-2-3, Quattro Pro) and other tools like word processors, terminal emulators, command shells and so on. This can be accomplished by means of
989-785: The VBA and Visual Studio object explorers and those for similar tools like the various script debuggers, e.g. Microsoft Script Debugger , and editors. WSH implements an object model which exposes a set of Component Object Model (COM) interfaces. So in addition to ASP, IIS, Internet Explorer, CScript and WScript, the WSH can be used to automate and communicate with any Windows application with COM and other exposed objects, such as using PerlScript to query Microsoft Access by various means including various ODBC engines and SQL , ooRexxScript to create what are in effect Rexx macros in Microsoft Excel , Quattro Pro, Microsoft Word , Lotus Notes and any of
1032-539: The Windows Script File (.WSF) is that it allows multiple scripts ("jobs") as well as a combination of scripting languages within a single file. WSH engines include various implementations for the Rexx , ooRexx , BASIC , Perl , Ruby , Tcl , PHP , JavaScript , Delphi , Python , XSLT , and other languages. Windows Script Host is distributed and installed by default on Windows 98 and later versions of Windows. It
1075-532: The OLE Automation interface of one application cannot be used to automate a different application, even if that application hosts the Visual Basic runtime, because the OLE Automation interfaces will be different. For example, a VBA program written to automate Microsoft Word cannot be used with a different word processor, even if that word processor hosts VBA. Conversely, multiple applications can be automated from
1118-469: The WSH, so any language can be used if there is an installed engine. In recent versions of the Take Command enhanced command prompt and tools, the "script" command typed at the shell prompt will produce a list of the currently installed engines, one to a line and therefore CR-LF delimited. The first example is very simple; it shows some VBScript which uses the root WSH COM object "WScript" to display
1161-485: The absence of any third-party Python installation; the same goes for the Rexx-programmable terminal emulator Passport. The SecureCRT terminal emulator, SecureFX FTP client, and related client and server programmes from Van Dyke are as of the current versions automated by means of the WSH so any language with an installed engine may be used; the software comes with VBScript, JScript, and PerlScript examples. As of
1204-564: The appropriate script engine and provides a set of services and objects for the script to work with. These scripts may be run in GUI mode ( WScript .exe) or command line mode ( CScript .exe), or from a COM object ( wshom .ocx), offering flexibility to the user for interactive or non-interactive scripts. Windows Management Instrumentation is also scriptable by this means. The WSH, the engines, and related functionality are also listed as objects which can be accessed and scripted and queried by means of
1247-454: The beginning. WinWrap Basic, SaxBasic and others are similar to Visual Basic for Applications, These tools are used to add scripting and macro abilities to software being developed and can be found in earlier versions of Host Explorer for example. Many other languages can also be used in this fashion. Other languages used for scripting of programmes include Rexx, Tcl, Perl, Python, Ruby, and others which come with methods to control objects in
1290-557: The current version of VBA ever since the release of the .NET Framework , of which versions 1.0 and 1.1 included a scripting runtime technology named Script for the .NET Framework . Visual Studio .NET 2002 and 2003 SDK contained a separate scripting IDE called Visual Studio for Applications (VSA) that supported VB.NET. One of its significant features was that the interfaces to the technology were available via Active Scripting ( VBScript and JScript ), allowing even .NET-unaware applications to be scripted via .NET languages. However, VSA
1333-803: The data in SecureCRT , as with other languages with installed engines, e.g. PerlScript , ooRexxScript , PHPScript , RubyScript , LuaScript , XLNT and so on. One notable exception is Paint Shop Pro , which can be automated in Python by means of a macro interpreter within the PSP programme itself rather than using the PythonScript WSH engine or an external Python implementation such as Python interpreters supplied with Unix emulation and integration software suites or other standalone Python implementations et al. as an intermediate and indeed can be programmed like this even in
WSH - Misplaced Pages Continue
1376-560: The different applications must be done explicitly through these application objects in order to work correctly. As an example, VBA code written in Microsoft Access can establish references to the Excel, Word and Outlook libraries; this allows creating an application that – for instance – runs a query in Access, exports the results to Excel and analyzes them, and then formats the output as tables in
1419-553: The host application, including manipulating user interface features, such as menus and toolbars, and working with custom user forms or dialog boxes. As its name suggests, VBA is closely related to Visual Basic and uses the Visual Basic Runtime Library. However, VBA code normally can only run within a host application, rather than as a standalone program . VBA can, however, control one application from another using OLE Automation . For example, VBA can automatically create
1462-475: The host applications ( Access , Excel , Word , Outlook , and PowerPoint ) store as a separate stream in COM Structured Storage files (e.g., .doc or .xls ) independent of the document streams. The intermediate code is then executed by a virtual machine (hosted by the host application). Compatibility ends with Visual Basic version 6; VBA is incompatible with Visual Basic .NET (VB.NET). VBA
1505-506: The like, the XLNT script to get environment variables and print them in a new TextPad document, and so on. The VBA functionality of Microsoft Office, Open Office (as well as Python and other installable macro languages) and Corel WordPerfect Office is separate from WSH engines although Outlook 97 uses VBScript rather than VBA as its macro language. Python in the form of ActiveState PythonScript can be used to automate and query
1548-677: The most commonly used are VBScript, JScript, PythonScript, PerlScript, ActivePHPScript, and ooRexxScript. The MKS Toolkit PScript program also runs Perl. Command shells like cmd.exe, 4NT, ksh, and scripting languages with string processing and preferably socket functionality are also able to be used for CGI scripting; compiled languages like C++, Visual Basic, and Java can also be used like this. All Perl interpreters, ooRexx, PHP, and more recent versions of VBScript and JScript can use sockets for TCP/IP and usually UDP and other protocols for this. The redistributable version of WSH version 5.6 can be installed on Windows 95/98/Me and Windows NT 4.0/2000. WSH 5.7
1591-447: The most recent releases and going back a number of versions now, the programmability of 4NT / Take Command in the latest implementations (by means of "@REXX" and similar for Perl, Python, Tcl, Ruby, Lua, VBScript, JScript and the like and so on) generally uses the WSH engine. The ZOC terminal emulator gets its ability to be programmed in Rexx by means of an external interpreter, one of which
1634-449: The one host by creating Application objects within the VBA code. References to the different libraries must be created within the VBA client before any of the methods, objects, etc. become available to use in the application. This is achieved through what is referred to as Early or Late Binding. These application objects create the OLE link to the application when they are first created. Commands to
1677-664: The operating system and the spreadsheet and database programmes. One exception is that the Zoc terminal emulator is controlled by a Rexx interpreter supplied with the package or another interpreter specified by the user; this is also the case with the Passport emulator. VBScript is the macro language in Microsoft Outlook 97, whilst WordBasic is used for Word up to 6, PowerPoint and other tools. Excel to 5.0 uses Visual Basic 5.0. In Office 2000 forward, true Visual Basic for Applications 6.0
1720-403: The same term [REDACTED] This disambiguation page lists articles associated with the title WSH . If an internal link led you here, you may wish to change the link to point directly to the intended article. Retrieved from " https://en.wikipedia.org/w/index.php?title=WSH&oldid=1214820789 " Category : Disambiguation pages Hidden categories: Short description
1763-648: The software with user preferences. End-users can protect themselves from attack by disabling macros from running in an application or by granting permission for a document to run VBA code only if they are sure that the source of the document can be trusted. In February 2022, Microsoft announced its plan to block VBA macros in files downloaded from the Internet by default in a variety of Office apps due to their widespread use to spread malware. As of July 1, 2007, Microsoft no longer offers VBA distribution licenses to new customers. Microsoft intended to add .NET-based languages to
WSH - Misplaced Pages Continue
1806-448: Was deprecated in version 2.0 of the .NET Framework, leaving no clear upgrade path for applications desiring Active Scripting support (although "scripts" can be created in C# , VBScript , and other .NET languages, which can be compiled and executed at run-time via libraries installed as part of the standard .NET runtime). Microsoft dropped VBA support for Microsoft Office 2008 for Mac . VBA
1849-766: Was restored in Microsoft Office for Mac 2011 . Microsoft said that it has no plan to remove VBA from the Windows version of Office. With Office 2010 , Microsoft introduced VBA7, which contains a true pointer data type: LongPtr. This allows referencing 64-bit address space. The 64-bit install of Office 2010 does not support common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) or MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar), so legacy 32-bit code ported to 64-bit VBA code that depends on these common controls will not function. This did not affect
#751248