共用方式為


Scripts and Automating Windows

Computers are wonderful tools that perform repetitive tasks. But what if you need to perform a series of repetitive tasks? The answer lies in scripting.

What Is a Script?

A script is a program written in a scripting language, such as JScript and VBScript. Alternative script languages include Rexx, Python, and Perl. When compared to programming languages such as C++ and Visual Basic, scripting languages are better suited to creating short applications that provide quick solutions to small problems.

Automating Windows

In many cases, scripts are used to automate manual tasks, much like a macro. Scripts are well suited for:

  • Manipulating the Windows environment

  • Running other programs

  • Automating logon procedures

  • Sending key sequences to an application

For example, if you have several similar tasks, you can write one generalized script that can handle all of them.

You can write scripts that start an action in response to an event. You can write scripts that keep a running tally of events and trigger some action only when certain criteria are met.

Scripts are also useful for nonrepetitive tasks as well. If a task requires you to do many things in sequence, you can turn that sequence of tasks into just one task by scripting it.

See Also

Concepts

Types of Script Files