Execution Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Execute-Commands >

Execution Commands

EXO. - Execute Open Document

Previous Top Next


MiniRobotLanguage (MRL)

 

EXO. Command

Execute Open Document

 

 

Intention

 

EXO. is an enhanced version of EXS. It will  simulate an "Explorer command".

 

EXO. will start a File or Document just like if you click on it with the right Mouse Button and choose something in the Explorer-Menu.

 

There are several options and Modes of operation. In the picture below you can see some examples.  "open" is the default option, which is used if you omit parameter P4.

 

 

graphic

 

Here are some examples:

 

' Print the file

EXO.?desktop\readme.txt|||print

 

EXO.?desktop\readme.txt|||edit

 

' Open the "Find Dialog"

EXO.?desktop\|||find

 

EXO. is a versatile command that can start nearly anything you can imagine. Also it will provide you with #pid# if possible. #tid# is not changed. Here is a sample script.

 

' Close all IE's

KPN.iexplore|a

' Open an IE

EXO.iexplore|"www.fa2.de"||open|(1+16+64)

MBX.PID of the new started process is: #pid#

ENR.

 

 

 

 

Syntax

 

 

EXO.P1[|P2][|P3][|P4][|P5]

 

 

Parameter Explanation

 

 

P1 - executable or Document-Filename or link, hyperlink

 

P2 - (optional) Parameter for executable that is been started

    Example:  EXO.iexplore|www.fa2.de

 

P3 - (optional) Folder for executable. This is for special purposes only. Current directory is set to this folder.

 

 

P4 - (optional) Action parameter

Some commonly used actions for P4 are:

 

edit

Launches an editor and opens the document for editing. If P1 is not a valid executable/document file, the function may fail.

 

explore

Explores the folder specified by P1. May need the specification of +32 for P5 to work.

 

find

Initiates a search starting from the specified directory. Opens the Find-dialog.

 

open

This is the default action, if none is specified. It opens the file specified by the P1 parameter. The file can be an executable file, a document file, a folder or an hyperlink.

 

print

Prints the document file specified by P1. If P1 is not a valid document file, or can not be printed, the function may fail.

 

properties

Displays the file or folder's properties.

 

runas

There is also a new action called "runas". Under XP it will show the "RunAs"-Dialog.

Under Vista and higher, it will launch the process as Administrator causing UAC elevation if required. Under the hood, it is the same as the explorer menu command "Run as administrator".

 

EXO.$$LNK|||runas

 

 

P5 - (optional) window-size and options parameter

 

0 - HIDE    -   Hides the window and activates another window.

1 - SHOW NORMAL   Activates and displays a window.

2 - SHOW MINIMIZED - Activates the window and displays it as a

   minimized window.

3 - MAXIMIZE -   Maximizes the specified window.

4 - SHOW-NO-ACTIVATE - Displays a window in its

   most recent Size and position.

   The active window remains active.

5 - SHOW - Activates the window and displays it

   in its current size and position.

6 - MINIMIZE - Minimizes the specified window and

   activates the next top-level window in the Z order.

7 - SHOW-MIN-NO-ACTIVE - Displays the window as

   a minimized window. The active window remains active.

8  - SHOW-NO-ACTIVE - Displays the window in its current state.

     The active window remains active.

9 - RESTORE - Activates and displays the window.

10 - SHOW-DEFAULT - Sets the SHOW STATE to default.

 

 

P5 - Special Flags

Add the following numbers to P5 to get the desired effect:

 

+16 - enable internal asynchronous execution (faster!)

 

+32 - Display Error-Messages and User Interfaces

Example:

' Leads to an error-message

EXO.iexplore|www.google.de||explore|33

 

+64 - Deactivates the built in "Wait-for-input-Idle".

If this flag is set, the script will not wait until the started executable is able to receive input. It will immediately return. This default-active builtin feature has an unchangeable time-limit of 60 seconds. Example with deactivated WII.:

 

EXO.iexplore|www.google.de||open|(33+16+64)

MBX.PID of the new started process is: #pid#

 

+128 - special quotation processing. If you use command-line-scripts and they do not work as expected, you can try this Option.

 

Hint: For better readability you can specify a formula as P5 like here:

 

EXO.excel|mysheet.xls||edit|(1+32+16+64)

MBX.PID of the new started process is: #pid#

 

Error-codes from EXO. on TOS.

 

0      - (no error) the command executed as expected

1      - OS reports out out memory

2      - The system cannot find the file specified.

3      - The system cannot find the path specified.

5      - Access to that file was denied.

8      - Not enough memory is available to process this command.

11     - The .EXE file is invalid (non-Win32 .EXE).

15     - The system cannot find the drive specified.

27     - The filename association is incomplete or invalid.

28 - 30  DDE-Errors

31     - This file-ending is not registered        

32     - There is a DLL is missing.  

 

 

 

Example

 

'***********************************************

' Example 1 - start new IE with Link

'***********************************************

VAR.$$LNK=http://www.fa2.de

' Will run internet explorer

EXO.iexplore|$$LNK

PAU.1

' Will run the default browser

EXO.$$LNK

:over

MBX.Halt to read output

'**********************************************

 

 

'***********************************************

' Example 2 - without Windows-Parameter

'***********************************************'

DBM.2

' Variables und Spezialfolder can be used.

EXO.?desktop\MR.txt

DMP.

:over

MBX.Halt to read output

'**********************************************

 

 

 

'***********************************************

' Example 3 - using Windows-Parameter

'***********************************************

' EXO. - Beispiel

DBM.2

' Variables und Spezialfolder can be used.

: §§FIL=http://www.fa2.de

EXO.§§FIL|§§WIN

DMP.

:over

MBX.Halt to read output

'**********************************************

 

 

:over

MBX.Halt to read output

'**********************************************

 

 

 

Remarks

 

Technical remark: EXO. uses extended ShellExecute-Technology and is compatible with other commands that use this technology.

 

EXO. can be blocked by a process that it has started. In this case specify the +64 and the +16  (= +80) parameter for P5. If that does not work, you can use EXF. in many cases.

 

Note that the returned PID in #pid# may not always be accurate, which is not a problem of the command but depends on target application design.

Some applications do behave that they do not keep the started process, but just open a TAB in an already open process. Examples are IE, or Chrome WEB-Browser.

In such cases you may need to first close all running instances using CAW. or KPN. and then start a new instance. In that case the #pid# will be the true PID of that instance.

 

For example when doing things like this, you will successfully open the browser(-Tab), but get only a zero as #pid#:

 

EXO.www.fa2.de||||(16+1)

MBX.#pid#

 

Error-messages:

It may be a good idea to enable error-messages, If you add +32 to the P5 flags, the command will display interactive User Interfaces and also Error-Messages, no matter if the command USM. is specified or not.

 

Zone-Check for downloaded files:

This command bypasses the "Zone Check" for files that have been downloaded from the internet.

 

Shortcut commands:

EXO. may work with some of these (depending on the OS):

 

EXO.system.ini

EXO.control

EXO.write

EXO.pbrush

EXO.winword

EXO.excel

 

' Start NetMeeting (XP)

EXO.conf

 

EXO. uses the default search path and will understand following shortcuts to these executables in the window-folder.

 

'  Will open system control panel (XP, Win 7)

EXO.control

 

' Will open "Control Panel\All Control Panel Items\Administrative Tools"

' XP, Win7

EXO.control admintools

 

' WIll open the  Clipboard Viewer

' XP only

EXO.clipbrd

 

' Systemconsole Prompt

' XP, Win7

EXO.CMD

 

' NotePad

' XP, Win7

EXO.notepad

 

' Windows Explorer

' XP, Win7

EXO.explorer

 

' XP, Win7

EXO.mspaint

 

' Open RegEdit

' XP, WIn7

EXO.regedit

 

 

' Windows Soundrecorder

' XP only

EXO.sndrec32

 

' Windows System Editor

' XP only

EXO.sysedit

 

You can use EXS. to open folders:

 

EXO.?ws\

EXO.?wi\

 

 

Limitations:

 

This command requires Windows XP, SP1 or higher.

 

 

See also:

 

    EXF. - Execute Fast

    EXS. - Execute Shell

    EXF. - Execute Fast

    EXH. - Execute-Handle

    GEP. - Get-Executable-Path