PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > SHELL command
SHELL command

 Allows to run DOS Commands, open documents or launch the execution of programs on the PC.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('SHELL')

CHGVAR

VAR(&PARM1) VALUE('DOC command | Document name')

CHGVAR

VAR(&PARM2) VALUE('
Wait
=True / False / Number
; Errorlevel
=True / False
; Visible
=True / False

; Focus=True / False 

; Minimize= True / False 
; OpenDocument
=True / False
; Directory=
Default directory
; Action=
open" | "explore" | "print" 
')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

DOS command to run on Windows station,
(ex: COPY F:\Docs\Template.doc C:\Temp).
Or, path to a document to open, or Internet URL to connect to.

 

 

Parm2

Wait = True / False / Number.
Default = True.
Application will wait until command processing ends, with no limit if Wait is True. If a value is given, the process will wait until the number of milliseconds has expired.

 

Errorlevel = True / False.
AS/400 program will receive error level as command call return.
Error level returns in &RESULT parameter as 5 digits code.

 

Visible = True / False. Default = False.
Command processing may be hidden.

 

Focus = True / False. Default = True.
If Focus is false, the active windows remains unchanged. This is useful to display documents or images, and keep the terminal emulation always active.

 

Minimize =True / False. Default = False.
If Minimize is true, the active window at the time of execution of this command will be minimized.
If Wait is not set to 'False', this window will be restored when the command completes.

 

OpenDocument = True / False. Default = False.
If this option is true, &PARM1 contains a file to open name path, or an Internet URL.
Windows will decide on the appropriate application according to the indicated file type.

 

Directory = Sets default directory of command to process, or document to open.

 

Action = Indicates a particular action to apply to a document.
"OpenDocument=" option is equivalent to Action="open".
Action values are : "open", "print", "explore".

 

 

Note

For some applications, like Internet Explorer, it is not possible to wait for the end of the command processing. Whatever you set for the Wait option, the command will be launched, and your process will continue immediately.

 

Examples

 

In this example a file is copied from a directory to another.

 

CHGVAR

VAR(&CMD) VALUE('SHELL')

CHGVAR

VAR(&PARM1) VALUE('COPY \Templates\Invoice.doc C:\Temp\Invoice.doc')

CHGVAR

VAR(&PARM2) VALUE('ErrorLevel')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)

 

In this example a Windows station is connected to a Web site.

 

CHGVAR

VAR(&CMD) VALUE('SHELL')

CHGVAR

VAR(&PARM1) VALUE('http://www.easycom-aura.com’)

CHGVAR

VAR(&PARM2) VALUE('OpenDocument')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)

 

In this example an HTML page is opened using the default navigator.

CHGVAR

VAR(&CMD) VALUE('SHELL')

CHGVAR

VAR(&PARM1) VALUE('\Pages\Document.htm')

CHGVAR

VAR(&PARM2) VALUE('OpenDocument')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)