The command LNCSHELL executes a DOS command, opens a document, or executes a program on a Windows station.
Parameters
Command, Document or Exe file. |
CDM |
|
Directory for the Doc. ou Exe |
FLR |
*NONE |
Parameters for the exe prog. |
PARMEXE |
*NONE |
Wait for the end of execution |
WAITCMD |
*NO |
Return back the ERRORLEVEL |
ERRORLVL |
*YES |
Run a visible mode |
VISIBLE |
*NO |
Placer la fenêtre en 1er plan |
FOCUS |
*YES |
Minimiser la fenêtre active |
MINCURWIN |
*NO |
Action on the document or Exe. |
ACTION |
*NONE |
Default directory. |
WRKFLR |
*NONE |
LAUNCHER PC Server to use |
EXESRV |
*DFT |
End options |
ENDOPT |
*ALL |
Details
Command, Document or Exe (CMD)
Enter : A DOS command, a document to open, or an executable program name.
Directory for the Doc. or Exe (FLR)
If the parameter CMD is a document or an executable program, then FLR can be the path to that file.
Notice : This parameter is optional if the full path is given with the parameter CMD.
A network path is valid: \\Serveur\Partage\repertory.
Parameters for the executable prog (PARMEXE)
If the parameter CMD is an executable program, then parameters to pass to the program can be specified.
Wait for the end execution (WAITCMD)
Possible values are :
*NO
The program does not wait for the command to be completed.
*YES
The program waits for the command to be completed on the PC.
Value
The job waits for the closing of the called program on the PC, up to a maximum delay expressed in milliseconds.
If the timeout has expired, the message LNC0701 is sent to the job, with the value 99999 in the first 5 characters.
Several programs, like Internet Explorer, does not allow to wait for the completion.
Return back ERRORLEVEL (ERRORLVL)
This option is valid only when WAITCMD is set to *YES.
Possible values are :
*YES
If a return code other than 0 is returned, the message LNC0701 is sent to the program.
The first 5 characters of the message
represent the error number.
The value 99999 is returned when the delay expressed by WAITCMD has been
exceeded.
*NO
The return of the command call is not tested.
Run in visible mode (VISIBLE)
Possible values are :
*NO
The command execution is hidden.
*YES
The command execution is visible.
Place the window in the foreground (FOCUS)
The possible values are:
*YES
The application window launched on the PC will be placed in the foreground of windows active on Windows.
*NO
The active window will remain unchanged.
This keeps the terminal emulation window always active.
Minimize the active window (MINCURWIN)
The possible values are:
*YES
The active window is minimized.
If WAITCMD is not *NO, the window will be restored at the end of the execution of the called program.
*NO
The active window remains displayed in its normal size.
Action on the document or Exe (ACTION)
This parameter is not used when CMD is a DOS command.
Possible values are :
OPEN
This value must be set when CMD is an executable program name.
When CMD is a document, the value OPEN allows to open the document on Windows, using its default application.
When CMD is a document, the value PRINT allows to print the document on Windows.
Default directory (WRKFLR)
Set the default directory during the execution of the command or program.
Launcher server to use (EXESRV)
Specifies the name of the server on which the command is to run.
This name may correspond to another workstation.
The host name or the IP address are valid choices.
Possible values are :
*DFT
The value from the keyword LNCSRV in file LNCDFTP is used.
*DEV
The command is processed on the PC where the terminal for the current job is located.
*CURRENT
When *CURRENT is specified, the current job must be already connected to a LAUNCHER Server on a PC.
That connection will be used.
adresse IP or hôte name
The command is processed on the specified PC.
Notice : The LAUNCHER server application must be running on the PC.
Ending Option (ENDOPT)
Specifies what object needs to be closed at the end of the process.
Possible values are :
*ALL
The LAUNCHER communication between the job and the PC server will be closed.
The program will not be able to reuse keyword *CURRENT for parameter EXESRV for the next call.
*NONE
LAUNCHER communication remains active.
The program will be able to reuse keyword *CURRENT for parameter EXESRV for the next call.
Example
Creating and opening a PDF file:
PGM
LNCOPEN
LNCCMD CMD(WORDOPEN) PARM1(NEW)
LNCCMD CMD(WTYPETEXT) PARM1('CECI EST UN FICHIER QUI A ETE +
CONVERTI EN FICHIER PDF')
LNCCMD CMD(PDFPRINTER) +
PARM1('FILE="C:\TEMP\TEMP.PDF"')
LNCCMD CMD(WPRINT) PARM1('PRINTER="LAUNCHER_PDF"')
LNCCMD CMD(WORDCLOSE)
LNCSHELL CMD('C:\TEMP\TEMP.PDF') WAITCMD(*NO) VISIBLE(*YES) +
ACTION(OPEN) EXESRV(*DEV)
LNCCLOSE
ENDPGM