3.16.4 Executing commands on client hosts
In JP1/IM, you can issue command requests from the Execute Command window to execute commands on client hosts (viewer hosts) as well as on managed hosts (agent hosts or manager hosts). This function is called the client application execution function.
The client application execution function does not use the JP1/Base functionality. This function will also let you execute a command to display windows.
A command executed on a client host (viewer host) by using this function is called a client application. You can also let a client application inherit event information.
|
For details about event inheritance, see 3.16.5 Inheriting event information when a command is executed. For details about how to execute a client application, see 7.1.1 Executing a command by using Command Execution and 7.1.2 Executing a command by using the Command button Job Management Partner 1/Integrated Management - Manager Administration Guide. To execute command on managed hosts, see 3.16.3 Executing commands on managed hosts from JP1/IM - View.
- Organization of this subsection
(1) Executable commands
The types of client applications are as follows:
-
Executable files (.exe)
-
Batch files (.bat)
However, the following commands cannot be executed:
-
Commands that require standard input
-
Commands that require redirection
-
Commands that use an escape sequence or control code
-
Internal commands, such as echo and copy
Note that client applications are executed by the OS user who launched JP1/IM - View.
- Important note
-
-
Spaces and tabs (control code: 0x09) specified for commands are identified as delimiters for command arguments. To specify a space or tab as a command argument, enclose the character string that contains the space or tab with double quotation marks (").
To specify a double quotation mark (") as a command argument, specify as \" by adding a backslash (\) before the double quotation mark ("). Note that \\" is identified as \ and ". If a backslash (\) is not placed before a double quotation mark ("), the character string subsequent to the double quotation mark (") is identified as an argument.
The following are examples of delimiting command arguments:
- Example of delimiting command arguments 1
-
Assume that the following command is specified:
c:\AppCommand.exe
test1
test2<tab>"test3
test4"
"test5<tab><tab>test6"
Legend:
<tab>: Tab (0x09)
: Space
Table 3‒24: Results of delimiting command arguments 1 No.
Delimiting status
Delimiting results
Description
1
Command
c:\AppCommand.exe
N/A
2
Argument 1
test1
Delimited by the preceding and following spaces.
3
Argument 2
test2
Delimited by the preceding space and the following tab.
4
Argument 3
test3
test4
Delimited by the tab before "test3 and the space after test4". Spaces enclosed with double quotation marks (") are not delimited.
5
Argument 4
test5<tab><tab>test6
Delimited by the space before "test5. Tabs enclosed with double quotation marks (") are not delimited.
- Example of delimiting command arguments 2
-
Assume that the following command is specified:
c:\AppCommand.exe
test1
test2<tab>"test3\"<tab>\"test4"
"test5
\\"
test6
Legend:
<tab>: Tab (0x09)
: Space
Table 3‒25: Results of delimiting command arguments 2 No.
Delimiting status
Delimiting results
Description
1
Command
c:\AppCommand.exe
N/A
2
Argument 1
test1
Delimited by the preceding and following spaces.
3
Argument 2
test2
Delimited by the preceding space and the following tab.
4
Argument 3
test3"<tab>"test4
Delimited by the tab before "test3 and the space after test4". \" is identified as ".
5
Argument 4
test5
\
Delimited by the spaces before "test5 and after \\". \\" is identified as \ and ".
6
Argument 5
test6
Delimited by the preceding space.
-
In Windows 8.1 (x64), Windows 8 (x64), Windows Server 2012 (x64), Windows 7 (x64), Windows Server 2008 (x64), and Windows Vista (x64), if you execute a command in the %WINDIR%\System32 folder, the WOW64 redirection function redirects the command. The WOW64 redirection function redirects the command to a command in the %WINDIR%\SysWow64 folder. If the command does not exist at the redirection destination, the command execution might fail. Be careful when you specify a command in the %WINDIR%\System32 folder as the execution command.
-
The executed command process inherits the user environment variables and system environment variables. If you specify %environment-variable-name% on the command line, however, the environment variable is not inherited.
-
(2) Conditions required for command execution
The following commands can execute client applications:
-
Commands placed on viewer hosts.
-
Commands that can be executed with the permissions granted to the OS user who started JP1/IM - View.
(3) Checking the command execution status and results
After you execute a client application, you cannot check the execution results (return value of the command, standard output, and standard error output) and the execution status from the Log in the Execute Command window of JP1/IM - View. The Log displays a message indicating that either the command was executed or that command execution failed.
To check the execution results of client applications, create a batch file to output the execution results to a file.
Client applications cannot be stopped from JP1/IM - View. The user must stop the client applications.
(4) Handling of user account control
When the user account control (UAC) of Windows is used, if an OS user other than administrator user starts JP1/IM - View and executes a command that requires administrator permission, the command execution is interrupted. When the command execution is interrupted, the Log field of the Execute Command window displays a message to indicate that startup of a client application failed. The user can execute a command in JP1/IM - View that was launched by clicking Run as an Administrator or can execute a command from the command prompt launched by clicking Run as an Administrator.
No. |
Permission required for command execution |
OS user who started JP1/IM - View |
||
---|---|---|---|---|
Administrator user |
User in Administrators group |
Other user |
||
1 |
Administrator |
Y |
|
|
2 |
Administrators |
Y |
Y |
|
3 |
None |
Y |
Y |
Y |
- Legend:
-
Y: Executable.
: A message is output, indicating that startup of the client application failed, and execution of the command is interrupted.