8.2.2 Command execution by list
- Organization of this subsection
(1) Overview of the function
This item sets the strings extracted from the list file for the parameters of the execution command, and executes the command the number of times equivalent to the number of lines.
(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 |
List file |
Yes |
String (1 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.
When you specify values extracted from the list file as parameters, use the following variables.
Information
Setting value
Description
Entire line
%r
Expands the entire line.
The nth string in a comma-separated list
%cn
Expands the nth element in a comma-separated list.
Specify an element number for n (valid values are %c1 to %c9).
%~cn
Use this variable when you want to remove double quotation marks (") from element strings to be specified as parameters if they are enclosed in double quotations. (Strings do not necessarily contain double quotation marks.)
Specify an element number for n (valid values are %~c1 to %~c9).
If you want to specify a percent sign (%), specify it as %%.
- List file
-
Specify the file name of the list file.
Use the following format for the list file:
-
Line delimiter: Newline character (\n, CR+LF or LF)
-
Element delimiter: Comma (,). Note that commas in double quotation marks are considered as a part of an element.
-
The maximum number of elements in a line: 9. Any delimiters in the elements after the ninth element are considered as normal strings.
-
Supported characters: Multibyte characters are also supported. Make sure that characters used match the OS locale.
-
The maximum line length: 8,192 bytes
-
The maximum number of lines: 1,024
-
The maximum file size: 8,192 kilobytes
-
- 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 |
Return values of execution commands. |
126 |
The internal processing of CPA ended abnormally during startup of the execution command.
|
(5) Example
Execution command |
cmd.exe |
Parameter |
/c xcopy /y %c1 c:\temp |
List file |
c:\temp\list.txt |
- Here are the contents of c:\temp\list.txt.
-
c:\1.txt,20150131,-wx
c:\2.txt,20150715,rw-
c:\3.txt,20151230,rwx
(6) Command name that is output to log files
cpaactlist.exe