The Portable Script Center
Version 3.0, November 2004
This help file contains all the scripts found in the TechNet Script Center (http://www.microsoft.com/technet/scriptcenter) as of November 5, 2004. Most of the scripts are designed to run with either Windows 2000, Windows XP, or Windows Server 2003, although many will also run on Windows NT 4.0 or Windows 98; in the latter two cases, however, you might need to install additional scripting technologies such as ADSI or WMI before the scripts will work. For more information about obtaining and installing ADSI, WMI, and the latest version of Windows Script Host (WSH 5.6), see the Script Center’s Scripting FAQ.
To help you identify which scripts will work with your computers, each script is accompanied by a table similar to this:
Supported Platforms
Windows Server 2003
Yes
Windows XP
Yes
Windows 2000
Yes
Windows NT 4.0
Yes, with Active Directory Client Extensions installed
Windows 98
Yes, with Active Directory Client Extensions installed
To use the scripts, copy the appropriate script code, paste the code into Notepad or another text editor, and save the file with a .vbs file extension. You can then run the script either by double-clicking the icon in Windows Explorer or by typing cscript at the command-line followed by the script name (this is generally preferred method of running the scripts). For example, to run the script my_script.vbs, type the following:
cscript my_script.vbs
For more information about these scripts, contact the Microsoft Scripting Guys at scripter@microsoft.com. If you would like to keep informed of the latest additions to the Script Center, receive beta copies of scripting utilities, and otherwise keep up-to-date on what’s going on in the world of scripting, subscribe to the Scripting Newswire. To subscribe to this free service (which is nothing more than periodic emails sent by the Scripitng Guys), send mail to scripter@microsoft.com, with the subject line Subscribe.
If you are interested in learning more about these scripts and how they work, check out the Microsoft Windows 2000 Scripting Guide. Many (but by no means all) of these scripts are featured in the Scripting Guide, along with a step-by-step explanation of what they do, how they work, and how they can be modified to better fit your individual needs. The Scripting Guide also provides a good introduction to basic scripting technologies such as WSH, VBScript, WMI, and ADSI.
A Note About the WMI Scripts
Most of the WMI scripts in this repository create a variable named strComputer, and then set the value of that variable to "." Thus, the scripts generally include this line:
strComputer = "."
This causes the script to run against the local computer. This is due to the way that the script has been composed, and the fact that WMI views a computer named "." as being the local computer. If you want to run the script against a remote computer, simply replace the "." with the name of the remote computer, surrounded by double quotation marks. For example, this line of code runs the script against a remote computer named PrintServer1:
strComputer = "PrintServer1"
This is the only change you need to make in order to run the WMI scripts against a remote computer. Bear in mind, however, that you will need to have administrative rights on the remote computer in order for the script to succeed. In addition, WMI must be installed both on the local computer and on the remote computer.