A.3 Different behaviors in different command execution environments
A command behaves differently depending on whether it is issued from CPA or issued manually in the command prompt. Check the following table if a command issued from CPA behaves differently from your expectation.
Item |
Description |
Issued from |
|||
---|---|---|---|---|---|
Command prompt (manually) |
Command execution#1 |
Command execution in window#2 |
Command execution as virtual user#3 |
||
User profile |
Is the user profile, information stored in the registry key HKEY_CURRENT_USER, loaded? |
Yes, the user profile is loaded. |
No, the user profile is not loaded. |
The system uses the profile of the user that is logged on to the console session or the Remote Desktop session.
|
Yes, the user profile is loaded (the profile of the Windows user associated with the virtual user name). |
WOW64 environment |
In a WOW64 environment, a 64-bit application located in %systemroot%\system32 cannot be called in the following cases:
|
No need to consider. |
Need to consider. (The command runs in a WOW64 environment.) |
||
Excel automation |
In a 64-bit operating system, if a service program includes VBScript code to interact with an Excel object, calling Excel automation from the service might result in a file-open error.
|
No need to consider. |
Need to consider. |
No need to consider. |
Need to consider. |
Runspace |
The CPA Command execution item runs in the service space. That is, the command cannot use environment variables, network shares, or other information that becomes available when the user is logged on.
|
No need to consider. (The command runs in the user session.) |
Need to consider. (The command runs in the service space.) |
No need to consider. (The command runs in the user session.) |
Need to consider. (The command runs in the service space.) However, the environment variables can be set. |
Environment variables |
User environment variables are not set for the execution environment of the CPA Command execution item. Available environment variables are limited to system environment variables, which are set when the service starts.
|
No need to consider. |
Need to consider. (User environment variables are unavailable.) |
Need to consider. (The system uses the environment variables of the user that is logged on to the console session or the Remote Desktop session.)
|
No need to consider. |
OS user to be used to run commands |
-- |
The user that started the command prompt |
The account of the CPA job execution service |
The user that is logged on to the session |
Windows user associated with the virtual user name. |
File handles |
Standard output, standard error output, and standard input are different. The ftp and timeout commands (provided with the operating system) might fail. |
No need to consider. |
Need to consider. (The ftp and timeout commands do not work.) |
No need to consider. |
Need to consider. (The ftp and timeout commands do not work.) |
Network share |
Can the command use a network drive letter that is assigned by Map network drive? |
Yes, the command can use the letter. |
This letter is not available when the user starting the CPA job execution service has a local system account (default account). #3 |
This letter becomes available when access is granted to the user logged on to Windows at the time when the Command execution in window item is executed. |
This letter becomes available when the UNC format (which starts with \\computer-name) is used. The Windows user associated with the virtual user name must be able to access the network drive. |
Current directory |
-- |
The current directory when the user runs the command. When the command prompt starts, the current directory is set to a folder that is specified in Start in of the Command Prompt properties. |
system-drive:\ProgramData\Hitachi\jp1\jp1_default\JP1CPA\work |
system-drive:\ProgramData\Hitachi\jp1\jp1_default\JP1CPA\work |
system-drive:\ProgramData\Hitachi\jp1\jp1_default\JP1CPA\work |