FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/Windows_Script_Host

Windows Script Host

Contents
Examples
Security concerns
Available scripting engines
Versions
links

Windows Script Host (WSH)
Other namesWindows Scripting Host
DeveloperMicrosoft
.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 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, Object REXX (ooRexx) (up to version 4.0.0), BASIC, Perl, Ruby, Tcl, PHP, JavaScript, Object Pascal Delphi, Python, XLNT, and other languages.

Windows Script Host is distributed and installed by default on Windows 98 and later versions of Windows. It is also installed if Internet Explorer 5 (or a later version) is installed. Starting with Windows 2000, the Windows Script Host became available for use with user login scripts.

.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 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 the start.

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 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 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, 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 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.

Examples

edit

The first example is very simple: a Hello, world program. It shows some VBScript which uses the root WSH COM object "WScript" to display 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

<job> <scriptlanguage="VBScript"> MsgBox"helloworld(fromvb)" </script> <scriptlanguage="JScript"> WScript.Echo("helloworld(fromjs)"); </script> </job>

Security concerns

edit

Windows applications and processes may be automated using 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 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 a trusted publisher, thus preventing the execution of untrusted scripts.

Available scripting engines

edit

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 a script with multiple languages in it in files with a .vbe

Default windows host script
JScript Microsoft JScript ECMAScript .js Installed by default Microsoft default install 1999 Yes
PerlScript Perl Perl 5 .pls with ActiveState Perl ActiveState Commercial 2001
XBScript xBase Scripting Engine xBase (Clipper) .xbs, .prg Clipper with XBScript software Various Open source
TclScript Tcl/Tk Tcl/Tk .tcls SourceForge ActiveState or third party Open source Earlier version of ActivePHPScript
RubyScript Ruby Ruby .rbs with Ruby distribution Ruby team Commercial 1997 An OpenVMS DCL-based multi-purpose scripting application for Windows
LuaScript Lua Lua .lua with Lua Lua organisation de facto Default install 2000 Macintosh too
Kixtart WSH Engine Kixtart KixTart, DOS, Windows 95. Windows NT shells .kix with KixStart Microsoft Netherlands Windows Resource Kits and other resources 1996 Download from Microsoft or elsewhere, aka KixStart32
NullScript NullScript Null language .ns with NullScript NullScript Organisation Windows Resource Kits and other resources 1999
ForthScript Forth Forth .fth, others Forth DMOZ Open source
CobolScript WSH Engine Cobol Cobol .cbl. .cob, .cb Fujitsu Cobol 3 Commercial 2003
DMDScript DMDScript D, a major incrementation of C .dmd DMD Distributions, download Open source 2013
Small C Scripting Engine C C (K&R, Ansi) .c, others Freeware
Take Command WSH Engine 4NT/Take Command TCC, the current version of 4NT p .btm, .cmd, bat, others Check JP Software JP Software Various independent programmers Various Various Lisp tools AutoLisp and others Freeware or Shareware
BESEN ECMA-JavaScript Java and Variants .bes, .bsn, others SourceForge BESEN Organisation Various Experimental 2015 CasioCalc.com, msgs of 15.09.2016</ref>"]}'>Planned Status as of 2015-09-30. Language has elements of Basic, Forth, Fortran, and others.
SharpCalcScript WSH Engine Sharp graphing calculators on-board programming language Sharp S-Basic as ported to windows as NeusSFortran .scsb Project Web/FTP Sites independent programmers Not applicable
Windows Server 2003 5.6 5.7
Windows Vista 5.7 Not applicable
Windows Server 2008 R2 5.8 Not applicable
Windows 10 5.812 2006, 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.

Versions

edit
Version Included with Also available for
1.0 Windows CE 3.0 (optional install on installer disc)
Windows 98, Windows 98 SE
Windows 95
Windows NT 4.0 SP3 or later
2.0 (also termed WSH 5.1) Windows 2000 RTM, SP1, SP2
Windows Me
Windows 95
Windows NT 4.0 SP4 or later
Windows 98
5.6 Windows 2000 SP3 and later
Windows XP RTM, SP1, SP2
Windows Server 2003
Windows 9x
Windows NT 4.0 SP6a or later
5.7 Windows XP SP3
Windows Vista
Windows Server 2008
Windows 2000 SP4 or later
Windows XP
Windows Server 2003
5.8 Windows 7
Windows 8
Windows 8.1
Windows Server 2008 R2
Windows Server 2012
Windows Server 2012 R2
N/a
10.0 Windows 11
Windows Server 2025 and later
  1. ↑ ?MSDN, "Windows Scripting Host" and "VBScript"
  2. ↑ MSDN April 2000 edition, "Windows Scripting Host"
  3. ↑ The VBScript Bible (1999)
  4. ↑ Windows 2000 Server Resource Kit (documentation
  5. 1 2 "What Is WSH?". msdn.microsoft.com. 24 October 2011. Archived from the original on 7 January 2018. Retrieved 30 April 2018.
  6. ↑ "Notes/Domino 4 and 5 Forum : RE: Suggestion: Make LotusScript a script engine for Windows Scripting Host". Archived from the original on 2015-03-21. Retrieved 2015-03-12.
  7. ↑ ASCI html help file
  8. ↑ ASCI site

links

edit

View original on Wikipedia | Back | FazBrowse Home