Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


6.1.4 Reserved variables

JP1/Script provides a number of reserved variables for referencing specific data (system information and command return values).

Table 6-2 shows the various categories of reserved variables and their meaning.

Table 6‒2: Reserved variables

Category

Reserved variable

Meaning

System reserved variable

_ALLRIGHT_

YES when the user has administrator privilege; Empty without administrator privilege.

_BIN_

Name of the work folder for the script file being executed. Followed by a backslash (\).

_COMP_

Name of the computer on which the script file is being executed.

_DOMAIN_

Name of domain on which the user is logged.

_OS_

Operating system and version:

  • For Windows 7 or Windows Server 2008 R2: WIN_NT6.1

  • For Windows Server 2012 or Windows 8: WIN_NT6.2

  • For Windows Server 2012 R2 or Windows 8.1: WIN_NT6.3

  • For Windows 10: WIN_NT10.0

_OS_PLATFORM_

Operating system:

  • WIN_NT

_OS_REVISION_

Operating system minor version:

  • For Windows 7 or Windows Server 2008 R2: 1

  • For Windows Server 2012 or Windows 8: 2

  • For Windows Server 2012 R2 or Windows 8.1: 3

  • For Windows 10: 0

_OS_VERSION_

Operating system major version:

  • For Windows 7, Windows Server 2008 R2, Windows Server 2012, Windows 8, Windows Server 2012 R2, or Windows 8.1: 6

  • For Windows 10: 10

_SCF_

Folder name of the script file being executed. Followed by a backslash (\).

_SCF_FIL_

File name of the script file being executed. No extension.

_SCF_EXT_

Extension of a script file (.SPT).

_SNF_EXT_

Extension of a menu information file (.SPN).

_SVF_EXT_

Extension of an execution environment file (.SPV).

_SDF_EXT_

Extension of a monitoring information file (.SPD).

_SYS_

MS-DOS startup folder name. Followed by a backslash (\).

_TEMP_

Folder name for temporary files. Followed by a backslash (\).

_USER_

User name of the person logged onto the system.

_WIN_

Windows folder name. Followed by a backslash (\).

_WINSYS_

Folder name in which the Windows driver resides. Followed by a backslash (\).

Process reserved variable

_PROC_ID_

Process identifier of the script being executed.

_ARGV_

Array variable that stores location variables from %1, accessed in the form _ARGV_(n) where n is any numeric starting at 1.

_ARGV_CNT_

Total number of location variables from %1. %0 is not included.

Command return value reserved variable

_COPY_RTN_

Execution result of the Copy command.

_COPY_CNT_

Number of files copied by the Copy command.

_COPY_SKIP_CNT_

Number of files not copied by the Copy command.

_COPY_SKIP2_CNT_

Number of files skipped with ErrSkip2 specified in the Copy command.

_EXEC_RTN_

Return value of the Exec, NetExec, or CallSpt command. Signed numeric.

_EXEC_ID_

Executable file ID for the Exec or NetExec command. Valid only when Flag is set to False (do not wait for called program to exit).

_JOB_RTN_

Return value of a job operating command.

_MSG_RTN_

Return value of the InputBox or MessageBox command.

_DLL_RTN_

Return value of an external function of the CallDll command.

_FORM_TERM_KEY_

Reason for termination of a window (menu form).

_FORM_TERM_CMDNO_

Command number when a window (menu form) is terminated by command execution.

_FORM_MODIFY_KEY_

Modifier key of the window (menu form) termination key.

_FORM_FIELD_NAME_

Name of the field that last had the focus.

_RTN_

Error detail code. Signed numeric.

Execution results of a command are set. However, for a command that returns a specific value (such as a character string manipulation command), 0 is always set in the _RTN_ reserved variable.

The cause of the error indicated in the error detail code will be output to the trace file as an error message.

_RTNxx_

Return value of the CallDll command (where xx is a number from 00).

_SVC_RTN_

Return value of a service operating command.

Character code reserved variable

_NL_

New line character.

_TAB_

Tab character.

Error detail code reserved variable

_NO_ERR_

No error.

_ERR_EOF_

End of file.

_ERR_TIMEOUT_

Timeout exceeded.

_ERR_FILE_

File not found.

_ERR_PATH_

Path not found.

_ERR_ACCESS_

Access denied.

_ERR_PROTECT_

Write-protected.

_ERR_READY_

Device not ready.

_ERR_EXCLUSIVE_

Another process is accessing the file.

_ERR_SVR_CONNECT_

Server does not respond to the connection request.

_ERR_SVR_TIMEOUT_

Timeout occurred while waiting for a response from the server.

_ERR_SVR_RECEIVEDATA_

Error occurred while receiving data from the server.

_ERR_SVR_NODATA_

Allowed time for no data transmission was exceeded during communication with the server.

_ERR_FILE_SIZE_

Value cannot be set in the variable because the acquired value exceeds the variable's maximum value.

_ERR_NOT_LARGE_FILE_

The size of the specified file is greater than the maximum value.

_ERR_FILE_POSITION_

Read/write start location is beyond 2,147,483,647.

_ERR_SERVICE_NOT_BEGIN_

The JP1/Script service is not running.