Automating processes and tasks

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Automating processes and tasks

  • Using the Windows interface

  • Using command-line tools

Using the Windows interface

The following table lists some of the most common tasks for automating processes and tasks, and the tools you can use to perform them. For more information, click the corresponding link under Tool or Feature.

Task Tool or feature

Automate routine or repetitive tasks.

Using batch files

Assign scripts to define settings for a group of users.

Group Policy (pre-GPMC)

Assign tasks that will be performed whenever a user logs on to a particular computer, such as mapping network drivers, starting background processes, and initializing user environment variables.

Logon Scripts

Run a group of commands in batch mode against a specified computer; save a configuration script in a text file for archival purposes, or to help you configure other computers.

Netsh overview

Schedule any script, program or document to run at a scheduled time.

Task Scheduler

Write a management script or batch file to automate administrative tasks.

Windows Management Instrumentation Command-line

Run scripts by clicking a script file on the Windows desktop or by typing the name of a script file at the command prompt.

Windows Script Host

Synchronize time on the computers in your network.

Windows Time Service

For more information about automating installations, see "Automating and Customizing Installations" at the Microsoft Windows Resource Kits Web site.

For more information about creating and using scripts, see the "System Administration Scripting Guide" at the Microsoft Windows Resource Kits Web site.

Using command-line tools

The following table lists some of the most common tasks for automating processes and tasks, and the command-line tools you can use to perform them. For more information, click the corresponding link under Command-line tool.

Task Command-line tool

Call one batch program from another without stopping the parent batch program.


Choose from among a set of user option keys such as Yes, No and Continue in a batch program.


Redirect command output from the command line to the Clipboard.


Recalls commands, edits command lines, and creates macros.


End localization of environment changes in a batch file, restoring environment variables to their values before the matching setlocal command.


Create a custom event in a specified event log.


List the events and event properties from one or more event logs.


Display and configure event triggers on local or remote computers.


Exit the current batch script or the Cmd.exe program (that is, the command interpreter) and return to the program that started Cmd.exe or to the Program Manager.


Run a specified command for each file in a set of files.


Select files in a folder or tree for batch processing.


Set the system environment variable %ERRORLEVEL% to the value associated with the specified Windows operating system.


Within a batch program, directs the operating system to a label; The operating system then processes the commands that begin on the next line.


Perform conditional processing in batch programs.


Sets the command path in the PATH environment variable, which is the set of directories used to search for executable files. Used without parameters, path displays the current command path.


Suspend the processing of a batch program and display a message that prompts the user to press any key to continue.


Change the current directory to the directory stored by the pushd command.


Store the name of the current directory for use by the popd command before changing the current directory to the specified directory.


Include comments (remarks) in a batch file or in your configuration files.


Communicate with the Service Controller and installed services; retrieve or set control information about services.


Schedule commands and programs to run periodically or at a specific time; manage the Task Scheduler service


Display, set, or remove environment variables.


Start localization of environment variables in a batch file.


Set environment variables in the local or system environment, without requiring programming or scripting.


Change the position of batch parameters in a batch file.


Pause the command processor for the specified number of seconds. Timeout is typically used in batch files.


Diagnose problems occuring with Windows Time.


Synchronize multiple computers across a network.


Locate and display all files that match the given parameter; by default, the search is done along the current directory and in the PATH environment variable.


For more information about the command shell, see Command shell overview. For information about tools used to manage the command-prompt window, see Manage the command-prompt window. For an alphabetical list of all of the command-line tools, see Command-line reference A-Z.