Hitachi

JP1 Version 12 JP1/Client Process Automation Configuration and Administration Guide


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.

Table A‒1: Differences between manually-issued commands and job-triggered commands

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.

Note

Ensure that the user is the same OS user that is used to run commands manually.

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:

  • When a file under %systemroot%\system32 is specified as the executable file for the action, the call is redirected to the %systemroot%\syswow64 path at run time. This can cause the executable file to fail to start or work properly.

  • If the access to the HKEY_LOCAL_MACHINE\Software or HKEY_CLASS_ROOT registry key is redirected to HKEY_LOCAL_MACHINE\Software\SysWow64, the executable file cannot get intended information. This can cause the executable file to fail to work properly.

Action to take

Specify the %systemroot%\sysnative path, instead of the %systemroot%\system32 path.

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.

Action to take

Check whether the following directories exist:

  • %SystemRoot%\SysWOW64\config\systemprofile\Desktop

  • %SystemRoot%\System32\config\systemprofile\Desktop

If these directories do not exist, create them. Then retry your operation to check whether the problem persists.

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.

Action to take

Use the Command execution in window item to run an interactive job or a job that needs to display a window.

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.

Action to take

Use the Command execution in window item or Command execution as virtual user to run a job that references a user environment variable.

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.)

Note

Ensure that the user is the same Windows user that is used to run commands manually.

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

#1

Command execution includes not only the Command execution with recovery option and Command execution by list items but also the action items for which Do not show the window was selected as the execution type when the custom items were created.

#2

Command execution in window includes the action items for which Show the window was selected as the execution type when the custom items were created.

#3

Command execution as virtual user includes the commands specified in Command execution with recovery option, Command execution by list, and Monitor any event. It also includes the action items for which Do not show the window was selected as the execution type when the custom items were created.

#4

This letter is available when the account of the user starting the CPA job execution service is changed to an account of the user with administrator privileges who has access to the network drive. However, the Command execution in window and Windows log on items cannot be executed with an account other than the local system account.