Previous Topic: Specifying the Command or Script Name Without the Full Path in a Windows JobNext Topic: Use a Windows Job Object to Manage Job Processing Properties


Run the Windows Command Interpreter

You can schedule a job to run a command using the Windows command interpreter (cmd.exe).

To run the Windows command interpreter

  1. Specify the path to cmd.exe using the CMDNAME statement in the job definition.

    The path to cmd.exe depends on your Windows operating system version. For example, on Windows NT, the path is C:\WINNT\system32\cmd.exe.

  2. Pass arguments to cmd.exe using the ARGS statement.

    You must enclose the arguments in double quotation marks and precede the argument with the /C switch.

You can do this to run any cmd.exe command.

Example: Copy a File to Another Location

This example uses cmd.exe to copy a file to another location.

AGENT NT30
CMDNAME C:\Windows\system32\cmd.exe
ARGS "/C copy C:\env.txt C:\test\env.txt"