Windows 7 and Vista Guide to Scripting, Automation
and Command Line Tools

by Brian Knittel

A Manual for the Windows Grease Monkey

Home

Downloads

Guestbook

Errata

Tips

Other Books

 

Downloadable Files

Click on any of the following links to download files mentioned in the book:

appendixes.zip Here are the bonus Appendixes E, F and G, which could not be included in the print edition of the book due to page count restraints.
samples.zip Sample Scripts & Batch Files
bottles.zip One possible solution to the "100 bottles" exercise on page 85
vbconstants.zip VBScript Constant Definitions
progexec.zip VBScript program that shows how to read output from a console (command line) program run from within the script.

Installing and Using the Sample Scripts

The file samples.zip contains many of the scripts and batch files shown in the book. You can use these files to experiment with scripting and programming concepts, and to use as the basis of your own scripts and batch files.

Download the zip file and save it to your hard disk. Extract the files to a folder on your hard drive using Windows Explorer or another ZIP file program such as WinZip. Be sure to extract the files with the "use folder names" option enabled, as the files are organized by chapter in numbered folders: 01, 02, and so on. I suggest that you extract the files into the folder c:\scripts, so that that you'll end up with folders c:\scripts\01, c:\scripts\02, etc.

To run a sample script or batch file, open a command prompt window and type the command

cd \scripts\##

where ## is the number of the chapter you're working with. The very first time you do this, also type the command

cscript //H:cscript

so that the default script engine is set to cscript (as described on page xxx). This just needs to be done once.

You can edit the sample scripts with notepad, with a command like this:

notepad script0101.vbs

and you can run the script by typing just its name:

script0101

Some of the sample scripts have hard-coded filenames, folder names and computer names in them. You'll have to modify these scripts to make them work on your computer.

If you run into any problems with the sample scripts, please use the guestbook to let me know.