OS Jobs Scripts Can Do
October 14, 2009Windows Script Host provides objects for manipulation of your scripts. Here are some of the tasks that these objects and services can do for you:
- Map network drives
- Connect to printers
- Modify environment variables e.g. Temp
- Run basic functions such as CreateObject and GetObject
- Print a message to a Message Box on screen
- Modify keys and values in the registry
The big picture of the scripting model
There are three layers in the script model.
- Top Layer: ActiveX, COM, DLL’s (You have to know your boundaries so I won’t go any further into ActiveX)
- Middle Layer: Script Engines VBScript, and JSCript (Equivalent of .bat files)
- Bottom Layer: WSH with :CSCript, WSCript, NWSCript also IE Explorer (Equivalent of DOS or CMD.exe)
So what is a Script?
A Windows 2000 script is a program written in a special language called JScript and VBScript. (If you prefer you could use Perl or Rexx) These scripting languages are designed to create short applications that provide quick solutions to network problems.
Different Types of Scripts
- vbs – VBScript files WSH
- js – JScript files for WSH
- wsf – Project file, container object for WSH files
- bat – DOS batch files
- html – Familiar ‘markup’ language.
- asp – Active Server Pages for webs
What is WSH ? (Windows Scripting Host)
- Windows Scripting Host is aptly named, think of it as providing an environment for hosting scripts. When a logon script arrives from the server, WSH makes sure objects and services are available for the script. It also check security and passes the script to the appropriate script engine. Example engine: ActiveX.
- WSH is ideal for non-interactive scripting jobs, such as logon configuration, administrative scripting, or machine automation