Windows 脚本构架
• 一般为 .js,.vbs 等文件
• 由相应的脚本宿主/引擎执行
• 一般是基于对象的,调用数量众多的脚本引擎及脚本对象模型中的功能
Windows 脚本宿主
• IIS:web服务器端脚本:INETINFO.exe
• IE: web客户端脚本:IEXPLORE.exe
• WSH 脚本(Windows Script Host) :WScript.exe/CScript.exe
Windows 脚本引擎
• Windows 内置的脚本引擎:JScript VBScript
• 第三方脚本引擎:PerlScript Python
Windows 脚本对象模型
• 一组实现了相关功能的对象的集合
• WSH,WMI,ADSI,ADO,CDO 等等
What Is the Windows Scripting Host?
The Windows scripting host is a language independent environment that exists on Windows based machines. It gives us the ability to write administrative scripts in various scripting languages. By default, Windows ships with a development environment for both VBScript and JScript, but you can install other runtime engines if you wish.
Once a runtime engine is installed, the Windows scripting host will choose the appropriate engine for the script that is attempted to run. For VBScript, there are two script hosts: Cscript.exe and Wscript.exe. Cscript.exe provides command line switches that enable you to supply arguments to modify the way your script runs. Wscript.exe is the default scripting host and provides Windows based dialog boxes.
自己编写了一个脚本文件,如后缀为 .vbs 或 .js 的文件,然后在 Windows 下
双击并执行它,这时,系统就会自动调用一个适当的程序来对它进行解释并执行,而这个程序,就是 Windows Scripting Host,程序执行文件名为 Wscript.exe (若是在命令行下,则为 Cscript.exe)