8.2.1 Command execution
- Organization of this subsection
(1) Overview of the function
This item executes actions using specified commands and parameters.
(2) List of settings
Name |
Required |
Format |
Can specify inherited information? |
---|---|---|---|
Execution command |
Yes |
String (1 to 512 bytes) |
Yes |
Parameter |
No |
String (0 to 512 bytes) |
Yes |
Virtual user name |
No |
String (0 to 512 bytes) |
Yes (The profile information cannot be specified.) |
(3) Settings
- Execution command
-
Specify the file name of the command to execute.
A command is executed as a child process of the job execution service. When commands that require interactive operations are executed, those commands can be left running if you cannot perform operations in the window. (You can check this by the Task Manager or an alternative.) If you execute a command that requires interactive operations, use the command execution with the window item.
If specifying a file whose extension is other than .exe or .bat, you need to associate the file extension with an appropriate application.
- Parameter
-
Specify the parameter for the execution command.
- Virtual user name
-
Specify the name of the virtual user mapped to the name of the Windows user who executes the item. If the virtual user name is omitted, the item is executed with the account for the CPA job execution service.
To map the virtual user name, use the cpasetumap command. For details on the cpasetumap command, see cpasetumap in 9. Commands.
(4) Return values
Value |
Description |
---|---|
Other than 126 |
The return value of the execution command. A value other than 0 indicates an abnormal end. |
126 |
The internal processing of CPA ended abnormally during startup of the execution command.
|
(5) Example
-
Execute the tasklist /V command.
Execution command
C:\Windows\System32\tasklist.exe
Parameter
/V
-
Execute the tasklist /V command and output the results to c:\temp\tasklist_work.txt.
Execution command
cmd.exe
Parameter
/C tasklist /V >c:\temp\tasklist_work.txt