[Previous] [Table of Contents] [Next]
What You Can Do with WSH Scripts
You can use scripts in many ways to customize your Windows system.
Here are some of the tasks you can automate using scripts:
- Back up or restore files on your system. (This capability is
particularly handy if you need to save only a few files from your
machine to a network server.)
- Shut down or restart Windows with a mouse click. You can also use
a script to add special shutdown or startup tasks, such as backing up
certain files after closing applications or logging a user's name
after booting the system. (The ability to log information via scripts
is especially useful in Windows 95 and Windows 98; in Windows NT and
Windows 2000, many logging features are built in.)
- Integrate applications and their data. For example, a script can
launch an Office application, load and process a document, print it,
and close the application. Using scripts in this way, you can
"associate" a document with any application you choose.
- Manage system administration tasks such as adding, updating, and
removing user accounts in Windows NT and Windows 2000. You can use a
WSH script to automate all these tasks by using the Active Directory
Service Interfaces (ADSI) provided with Windows NT and Windows
- Directly access the Windows shell through suitable objects (to
create shortcuts or map network devices such as drives or
- Read environment variables or retrieve information about
- Launch programs and control Automation objects.
- Display dialog boxes that inform the user about the program
status or retrieve user input.
- Access the Windows shell and Windows application programming
interface (API) to control windows and other applications.
A Few Remarks About VBScript and JScript
WSH, which ships with Windows 98 and Windows 2000 (and comes in a
downloadable version for Windows 95 and Windows NT 4), comes with two
programming languages, VBScript and JScript. VBScript uses the same
syntax as Visual Basic; it is actually a subset of Visual Basic.
JScript is Microsoft's implementation of ECMAScript, the
These two programming languages are all you need to enter the world
of script programming. However, Microsoft designed an open interface
for WSH so that third-party vendors can integrate their own language
engines to support other languages such as Perl, Tool Control Language
(Tcl), and Rexx.