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.
|
Call
|
|
Choose from among a set of user option keys such as Yes, No and Continue in a batch program.
|
Choice
|
|
Redirect command output from the command line to the Clipboard.
|
Clip
|
|
Recalls commands, edits command lines, and creates macros.
|
Doskey
|
|
End localization of environment changes in a batch file, restoring environment variables to their values before the matching setlocal command.
|
Endlocal
|
|
Create a custom event in a specified event log.
|
Eventcreate
|
|
List the events and event properties from one or more event logs.
|
Eventquery.vbs
|
|
Display and configure event triggers on local or remote computers.
|
Eventtriggers
|
|
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.
|
Exit
|
|
Run a specified command for each file in a set of files.
|
For
|
|
Select files in a folder or tree for batch processing.
|
Forfiles
|
|
Set the system environment variable %ERRORLEVEL% to the value associated with the specified Windows operating system.
|
Gettype
|
|
Within a batch program, directs the operating system to a label; The operating system then processes the commands that begin on the next line.
|
Goto
|
|
Perform conditional processing in batch programs.
|
If
|
|
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.
|
Path
|
|
Suspend the processing of a batch program and display a message that prompts the user to press any key to continue.
|
Pause
|
|
Change the current directory to the directory stored by the pushd command.
|
Popd
|
|
Store the name of the current directory for use by the popd command before changing the current directory to the specified directory.
|
Pushd
|
|
Include comments (remarks) in a batch file or in your configuration files.
|
Rem
|
|
Communicate with the Service Controller and installed services; retrieve or set control information about services.
|
SC
|
|
Schedule commands and programs to run periodically or at a specific time; manage the Task Scheduler service
|
Schtasks
|
|
Display, set, or remove environment variables.
|
Set
|
|
Start localization of environment variables in a batch file.
|
Setlocal
|
|
Set environment variables in the local or system environment, without requiring programming or scripting.
|
Setx
|
|
Change the position of batch parameters in a batch file.
|
Shift
|
|
Pause the command processor for the specified number of seconds. Timeout is typically used in batch files.
|
Timeout
|
|
Diagnose problems occuring with Windows Time.
|
W32tm
|
|
Synchronize multiple computers across a network.
|
waitfor
|
|
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.
|
Where
|