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)