Sampling the Power of ScriptIt
Listing 3 is a script that automates creating a new Line Print Remote (LPR) printer port and HP LaserJet 4 Plus shared printer definition on an NT workstation. You can create an LPR port only from the GUI. Listing 3 illustrates many of ScriptIt's features. Although this script appears long and complicated, it performs simple tasks.
Listing 3 contains many REM statements. Adding comments to your scripts always helps other users interpret them. The script includes many examples of ScriptIt's keystroke separator and 5-second delay options. The keystroke separator saves me from repeatedly typing each window title. I use the 5-second delay frequently because without the delay, Listing 3's script processes too quickly for ScriptIt to keep up. I never use the keystroke separator and 5-second delay on the same line so that the window controls can keep up with script processing. Listing 3 uses the mkfile command to create a temporary batch file that echoes the name of the computer the script runs on. Listing 3 then uses the apostrophe to call the batch file to enter the computer name in a dialog box.
To execute this script, which I named addport, I type
scriptit addport
from a command line or Start menu Run command. A ScriptIt icon on the taskbar lets you keep track of the script. You can right-click this icon to terminate your script before it completes. When you terminate a script prematurely, ScriptIt leaves a temporary file in your %temp% directory. To find these files, look for numbered files without extensions. You must delete these files manually.
A Power Tool for Automating That Last 10 Percent
You can script approximately 90 percent of NT configuration tasks from the command line through a combination of built-in commands, resource kit utilities, and third-party scripting tools. The remaining tasks don't have command-line support, so you must perform them from the GUI. ScriptIt is the ideal tool for these kinds of tasks. ScriptIt is also ideal if you're trying to automate an NT installation on hundreds of systems: It lets you script tasks you can't otherwise script (e.g., sound driver installations) so your NT installation is as hands-off as possible. Using NT 4.0's unattended
installation process, you can include a ScriptIt script to install sound drivers during the initial workstation installation using the runonce option. This option prevents you from returning to each workstation and installing sound drivers manually. ScriptIt provides ease of use (no programming is necessary), flexibility, and extensibility. ScriptIt is one of the more interesting tools to come out in a while.