|
Guy recommends :
Find out which of your VMs are a waste of space and which VMs need more resources. |
WSH - HomeIntroduction to WSH (Windows Scripting Host)The key word in understanding WSH is Host. WSH (Windows Scripting Host) provides the environment to run scripts like VBScript or JScript. This is a big improvement over running .bat files in the CMD/DOS 'host'. Another analogy is the way Internet Explorer acts as a 'host' for displaying Dynamic HTML. The more you learn about WSH, the more you realize how versatile this host is. For starters, it supports not only VBScript, but also JScript, Perl, Rexx and Python. WSH leverages objects and methods from WMI (Windows Management Instrumentation) and ADSI (Active Directory Service Interface). The secret of WSH, like any good host, is the ability to look after its guests; in this case to service WMI and ADSI requests. In practical terms, it means that you creating scripts which interact with the Windows Server operating system. VBScript (or other scripting language)If WSH is the host or container, then think of VBScript as the glue. What actually happens is VBScript attaches to ADSI and then pastes the user object into the script. WSH in action
♦ CScript.exe and WScript.exeThese are the actual executables that perform all the WSH tasks. Mostly I use the command line CScript. The latest version of CScript is 5.6, this is built-in to Windows Server 2003. Windows 2003 ships with version 2.0 but this is upgraded to the 5.6 version when you install Service Pack 3 or later. You can check out either CScript or WScript by simply running either at the CMD prompt. Also investigate file type association to make the connection between .vbs extensions and CScript.exe (Windows Scripting Host). Topic - Simple WSH ScriptThe purpose of my sample script is to check the version numbers of WSH, VBScript, WMI, and ADSI. This is what the output of your script will look like. Note the subtle differences in the names of the 4 executables: WSH, VBScript, WMI and ADSI. Check out the part of the script where the major and minor version numbers are joined (concatenated) to echo the final result.
Guy
Recommends: Permissions Analyzer - Free Active Directory Tool
|
||||
Custom Search
|
Guy Recommends: WMI Monitor and It's Free!
|
|
Home Copyright © 1999-2012 Computer Performance LTD All rights reserved Please report a broken link, or an error. | |