Compaq. Better Answers.

PC Magazine

  PC Tech

The Windows Scripting Host

Introduction

Active Scripting

The Windows Scripting Host Object Model

The WshShell and WshNetwork Objects

Putting It Together

Figure 1: Mapping Network Drives

Figure 2: Creating URL Shortcuts



First USA!

NextCard Internet Visa - Apply Now

 
  Categories:
Scripting Languages
Windows 95/NT
Operating Systems
The Windows Scripting Host
Active Scripting

Continued from Introduction

Active Scripting is a relatively new scripting standard from Microsoft. There isn't enough space in this article to discuss it thoroughly, so we'll take a quick look at Active Scripting from 10,000 feet.

Until now, there was not a standard method of adding scripting support to applications under Windows. If you wanted to make an application scriptable, there were two choices: one, roll your own scripting, or two, buy a third party's scripting technology. Both of these solutions are less than perfect, and both lock the developer into a proprietary technology.

To remedy this situation, Microsoft introduced Active Scripting--a set of ActiveX interfaces that let developers add language-independent scripting to their applications. That's important, so I'll say it again--language-independent scripting. Active Scripting accomplishes this by using two main components, scripting hosts and scripting engines.

Any application that can be driven by Active Scripting is a scripting host. From the scripting host's point of view, there is no scripting language; that is, the host does not process any scripting-language commands. The host starts a scripting engine, feeds lines of a script to it, and responds to its output, but the host never looks at the actual script. The scripting engine deals with all language-dependent issues.

A scripting engine must be written for each scripting language that Active Scripting supports, although to the scripting host, they all look the same. Microsoft currently supplies scripting engines for VBScript and JavaScript, and third parties are working on scripting engines for Perl, Rexx, Python, and other languages. The beauty of this scheme is that it lets end users write scripts in the languages they like best.

With the above background, the name Windows Scripting Host probably has a little more meaning to you now. At a base level, the Windows Scripting Host is an Active Scripting host that lets scripts be executed in the Windows shell. You can write a script in any supported language, and the Windows Scripting Host will use the script file's three-character extension to determine what language you wrote the script in (.VBS for VBScript, for example) and which scripting engine to start.

Continues. . .

Published as Operating Systems in the 02/10/98 issue of PC Magazine.


 SPONSORED LINKS
@Backup   Your Solid Online Backup Plan. Download Now.
Services   9c/MINUTE LONG DISTANCE, 5c/MINUTE ON SUNDAYS!
STORAGE   Quantum means non-stop business, 24 hours a day
Software   X10.com -- The SuperSite for Home Automation
Books   Bargain Books up to 90% off at barnesandnoble.com
 ZDNET FEATURED LINKS
Downloads   Check out the best new downloads in Reviewer's Raves
Bargains!   Shop the Basement for best buys on computer products
Free Help   Got computing questions? ZDHelp has all the answers!
 MAGAZINE OFFERS
Free Offer   Get a FREE SUBSCRIPTION to Inter@ctive Week

TOP
Copyright (c) 1998 Ziff-Davis Inc.