What Is WSH?

Windows Script Host (WSH) is a Windows administration tool.

WSH creates an environment for hosting scripts. That is, when a script arrives at your computer, WSH plays the part of the host — it makes objects and services available for the script and provides a set of guidelines within which the script is executed. Among other things, Windows Script Host manages security and invokes the appropriate script engine.

WSH is language-independent for WSH-compliant scripting engines. It brings simple, powerful, and flexible scripting to the Windows platform, allowing you to run scripts from both the Windows desktop and the command prompt.

Windows Script Host is ideal for noninteractive scripting needs, such as logon scripting, administrative scripting, and machine automation.

就像 Microsoft Internet Explorer 一样,Windows 脚本宿主充当ActiveX 脚本引擎的控制器。但是,与 Internet Explorer 不同,Windows 脚本宿主只需要很少的内存,所以非常适合于交互和非交互的脚本,如登录脚本和管理脚本。

Windows 脚本宿主有两个版本:基于 Windows 的版本 (Wscript.exe),它提供用于设置脚本属性的属性表;另一个是基于命令提示符的版本 (Cscript.exe),它提供用于设置脚本属性的命令行开关。通过在命令提示符下键入 Wscript.exe 或 Cscript.exe 可以运行其中的一个。

原文地址:https://www.cnblogs.com/whyandinside/p/1544983.html