jp1exec (Windows only)
- Organization of this page
Format
jp1exec command-line
Description
The jp1exec command executes the program (command) specified on the command line, and saves the return code of the executed program in a temporary file. For details about this temporary file, see Additional information below.
This command is used in a batch file (.bat or .cmd) executed as a job on the target host. Normally, when a job is forcibly terminated, the batch file executed as the job is forcibly terminated but the programs executed from the batch file are not forcibly terminated. However, if a program is executed via the jp1exec command in a batch file, the program is forcibly terminated when the batch file is forcibly terminated. If you specify the jp1exit command at the end of a batch file, the return code of the program executed by the jp1exec command can be used as the return code of the batch file.
Execution privileges
None
Arguments
command-line
Specify the full path name of an executable file that you want to execute as a job on the target host. You can also specify arguments (parameters) for the executable file. As an executable file, you can only specify a file whose extension is exe. If you specify a file whose extension is not exe, the corresponding job might end abnormally.
You can specify a character string of 1 to 259 bytes.
The system behavior differs depending on whether the number of characters in the first argument exceeds the maximum or the total number of characters on the command line exceeds the maximum.
-
If the number of characters in the first argument exceeds the maximum
The command results in an error.
-
If the total number of characters on the command line exceeds the maximum
The system assumes that only the space-separated elements existing within the maximum length are specified on the command line.
- Example:
-
jp1exec C:\test.exe aaa...a
If the number of characters in C:\test.exe aaa...a exceeds the maximum, the system discards aaa...a and executes the command using C:\test.exe.
Notes
-
This command cannot be used in UNIX.
-
This command can be used only in JP1/AJS3. It cannot be used for a request from JP1/AJS3 to JP1/OJE for VOS3.
-
If multiple jp1exec commands are specified in one batch file, the return code of the program executed by the last jp1exec command is saved in a temporary file as the return code of the batch file.
-
Only a file having the EXE extension can be specified in this command. If a file whose extension is not EXE is specified, the job might terminate abnormally. Code the following command to call from one batch file to another.
jp1exec CMD.EXE /C file-name
Note, however, that if a batch file that contains the above coding is terminated forcibly (CMD.EXE is terminated forcibly), the programs started from the batch file are not terminated forcibly. To terminate these programs forcibly, make sure that the programs are executed by the jp1exec command.
The result of the EXE file or batch file called from the jp1exec command cannot be redirected to the standard output file or the standard error output file.
-
If the jp1exec command is executed in a batch file called from another batch file being executed as a job, forcibly terminating the batch file being executed as a job also forcibly terminates the processes executed by the command.
-
The return code of the jp1exec command is different from the return code of the program executed by the jp1exec command. To acquire the return code of the program executed by the jp1exec command, you must also specify the jp1exit command. If you do not specify the jp1exit command, the return code of the jp1exec command itself becomes the return code of the batch file. For details on the jp1exit command, see jp1exit (Windows only) in 3. Commands Used for Normal Operations.
-
Of the environment variables in a batch file, you must not change those environment variables starting with TMP, TEMP, or JP1 or those environment variables starting with AJS.
-
If you use a path name that includes a space character for the file specified by the jp1exec command, you must enclose the path name by double quotation marks (") and (\"). If you do not enclose the path with these symbols, the command may fail.
The following is an example in which the execution file name is C:\Program Files\test.exe.
jp1exec "\"C:\Program Files\test.exe\""
-
To execute the command, set write privileges and read privileges for the OS user who executes the job on the following folders:
If the JP1/AJS3 installation folder is the default installation folder or is in a folder protected by the system:
-
%ALLUSERSPROFILE%\Hitachi\JP1\JP1_DEFAULT\JP1AJS2\log\jpqagent
-
%ALLUSERSPROFILE%\Hitachi\JP1\JP1_DEFAULT\JP1AJS2\log\jpqclient
The default of the %ALLUSERSPROFILE% value is system-drive\ProgramData.
If the JP1/AJS3 installation folder is other than the above:
-
JP1/AJS3-installation-folder\log\jpqagent
-
JP1/AJS3-installation-folder\log\jpqclient
When using the system in a cluster configuration:
-
shared-folder\jp1ajs2\log\jpqagent
-
shared-folder\jp1ajs2\log\jpqclient
-
Additional information
If you use the jp1exec command, make sure that you also specify the jp1exit command. If you do not specify the jp1exit command, a file whose name begins with AJSJP1EXEC remains on the host on which the job is executed. If this file, which is no longer necessary, remains, delete it manually.
This file is created at the first path found in the environment variables searched in the order shown below. If no path is set in any of the environment variables, the file is created in the Windows installation folder.
-
Environment variable tmp of the user# that starts the JP1/AJS3 service
-
System environment variable tmp
-
Environment variable temp of the user# that starts the JP1/AJS3 service
-
System environment variable temp
For the paths set for the above environment variables, set write and read permissions so that they can be accessed by the OS user who executes the job.
- #
-
For a queueless job, the user who starts a queueless agent service.