Hitachi

JP1 Version 12 for Windows Systems JP1/File Transmission Server/FTP Description, Reference and Operator's Guide


3.3.1 Registering auto-start programs

The following features characterize auto-start programs:

To register auto-start programs:

  1. In the Auto-Start Program Registration window, from the Register menu, choose For File Trigger or For Directory Trigger. Alternatively, select existing registration information, and then from the Register menu, choose For File Trigger or For Directory Trigger.

    The Register Auto-Start Program dialog box appears.

    Figure 3‒6: Register Auto-Start Program dialog box (for files)

    [Figure]

  2. Specify the items and then click Register.

    You can make entries for multiple auto-start programs one after another until you click Close.

  3. After registering the programs, click Close.

The following table lists and describes each item in the Register Auto-Start Program dialog box.

Table 3‒4: Items in the Register Auto-Start Program dialog box

Item

Setting

User name

((user displayed in the list))

Specifies a user name for registering an auto-start program. This item is mandatory.

The following users displayed in the drop-down list can register auto-start programs.

  • Users who have been registered as JP1/FTP login users

  • .default (default users): All users who have been registered as login users

    When there is no registration information that corresponds to an individual user, JP1/FTP references the default user registration information. If such an item is found, JP1/FTP starts those programs automatically.

When a user name is already set in User name:

If a user has been specified in Info. For Specific User in the View menu, that user name is displayed here. From the View menu, choose Info. For All Users.

File name/Directory name

((1 to 259-byte character string))

Specifies the name of the file or directory that is to be subject to automatic start. This item is mandatory.

If you specify a file, specify its full path or only the file name. If you specify a directory, specify its full path. For the directory delimiter, use \.

Program to start when transmission ends normally

Program to start when transmission ends abnormally

((2 to 259-byte character string))

Specifies the program to start when transmission terminates normally and/or when transmission terminates abnormally.

For the name of a program to start, specify its full path. When the program starts, transmission information can be passed as arguments. For details, see (1) Parameter keywords. Note that if the length of the expanded parameter keywords exceeds 2,047 bytes, start processing of the specified auto-start program will fail.

When a program name contains a space:

If the specified program name contains a space, enclose the entire program name in double-quotation marks (").

Example: When specifying c:\aaaΔbbb\cccΔddd.exe as the name of an auto-start program:

"c:\aaaΔbbb\cccΔddd.exe:" (Δ: Single-byte space)

Note that in the case of a batch file, if you enclose both the program name and the arguments in double-quotation marks, the arguments will not be passed correctly.

About JP1EVENT specification

Events cannot be issued by specifying JP1EVENT for program names supported in older versions.

To issue an event, use the JP1/Base jevsend.exe command and specify a full path.

About the programs to start

Because the specified programs are started from the JP1/File Transmission Server/FTP Server service, we recommend that you note the following:

  • Make sure that the account (user) used to start the JP1/File Transmission Server/FTP Server service is authorized to execute the specified programs.

  • Because automatic start of programs is executed in a service session that is independent of the user's logon session, some of the information might not be readable (such as the registry settings specified during the user's logon session).

  • An auto-start program cannot have a graphical user interface. If you specify that a program with a graphical user interface is to start automatically, JP1/FTP processing might be affected adversely and the service might stop during operation.

Priority of program start

If multiple auto-start programs have been registered, the start condition (file name or directory name) might be applicable to more than one of the programs. In such a case, JP1/FTP searches the programs based on the priority order described below and starts only the first program that satisfies a priority condition. The following figure shows the priorities.

Figure 3‒7: Priority of starting auto-start programs

[Figure]

How to start programs when multiple files are transmitted

If a wildcard is used to transmit multiple files, an auto-start program is started as many times as there are file transmissions. Information is inherited to the auto-start program separately for each transmission. The transmission information cannot be inherited to all instances of the auto-start program at once.

Organization of this subsection

(1) Parameter keywords

You can pass all the transmission-end information items to the user program by specifying a keyword in the auto-start program. You can also use keywords to pass specific transmission-end information items. The following table lists and describes the keywords.

Table 3‒5: List of parameter keywords

Parameter keyword

Information that is output

Client

Server

ALL

All the following items

Y

Y

TRNO

Transmission number

Y

Y

TCNO

Connection number

Y

Y

CARD

Card name

Y

--

HOST

Connection-target host name or IP address

Y

--

Connecting client's IP address

--

Y

PORT

Connection-target host's port number

Y

--

USER

Login user name

Y

Y

TRTP

Transmission mode:

1: ASCII

2: Binary

Y

Y

TRCM

Transmission command:

1: Send

2: Receive

3: Append

Y

Y

COMP

Compression mode:

1: Stream

2: Compress

Y

Y

LCFN

Local file name

Y

Y

RMFN

Remote file name

Y

--

STTM

Transmission start time (return value of time())

Y

Y

SPTM

Transmission end time (return value of time())

Y

Y

TRSZ

Transmission data size (bytes)

Y

Y

CMNT

Comment

Y

--

TRST

Transmission end status:

1: Success

2: Failure

Y

Y

ERKD

Error type:

1: System call error

2: Logical error

3: Protocol error

5: SSL communication error

Y

Y

SYCN

System call name

Y

Y

SYKD

System call type:

1: Win32 API

2: C runtime

3: Winsock API

Y

Y

ERNO

Error number

Y

Y

PLMG

Protocol message

Y

--

SSLE

SSL communication error number

Y

Y

Legend:

Y: Enabled

--: Disabled

About keyword specification
  • If any keyword other than the ones shown in the table above or an invalid keyword is specified, the specified keyword is passed to the user program.

  • If arguments to be passed to an auto-start program contain any spaces, you must enclose the keywords in double-quotation marks.

Example: "ALL"

When keywords are enclosed in double-quotation marks, the arguments are passed differently between .exe and .bat files, as shown below:

Example: A.exe "PLMG"  aargv[1]=aaa  bbb
Example: A.bat "PLMG"  a%1="aaa  bbb"
Example of argument specification

The following shows an example of specifying arguments.

All transmission-end information:
C:\USERS\accounting\PROC ALL
Selected transmission-end information:
C:\USERS\accounting\PROC1 TRNO USER TRCM STTM SPTM
C:\USERS\accounting\PROC2 "PLMG"
Command line during execution

Example 1: Specifying keywords (without double-quotation marks):

Specification:
C:\USERS\accounting\PROC1 TRNO USER TRCM STTM SPTM
Execution command line:
C:\USERS\accounting\PROC1 12 accounting 1 12:45:35 12:45:45
(Transmission connection number: 12, login user name: accounting, transmission command: send(1), transmission start time: 12:45:35, transmission end time: 12:45:45)

Example 2: Specifying keywords (with double-quotation marks):

Specification:
C:\USERS\WAKA\PROC2 "PLMG"
Execution command line:
C:\USERS\WAKA\PROC2 "550 D:\temp\test.dat:The system cannot find the path specified."
(Protocol message: 550 D:\temp\test.dat:The system cannot find the path specified.)

The user can obtain the entire command line character string by using the GetCommandLine function within the termination procedure. If the user program is a C runtime process, you can use the mechanism of argc and argv.