Execution Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Execute-Commands >

Execution Commands

EXV. - Execute via System-Desktop

Previous Top Next


MiniRobotLanguage (MRL)

 

EXV. - Execute via System-Desktop

Execute Blocking via System-Desktop.

 

 

Intention

 

Run an executable on the hidden System-Desktop synchronously and deliver the exit-code.
The current script is suspended until the called program ends.

 

What is the System-Desktop?

Imagine there is a hidden place in your computer, where you can execute all your automation scripts, and the user can not see it,

because its on another desktop. You can even click on Buttons, using the Mouse!

 

 

2015-03-20 13_09_34-Windows 7 x64 Edition - VMware Workstation

 

Notice that this picture was made using the following Script using the Compiler-directive "'#EXV:", NOT using the command EXV.

 

 '#EXV:itsme

  MBX.Hallo, I am the Smart Package Robot.

  ENR.

 

 

Generally for most tasks, the Compiler-directive '#EXV: is more useful then using the EXV.-command.

EXV. as a command will only start another task on the "Hidden desktop". The robot itself will stay on the normal user-desktop.

Using the compiler-directive '#EXV:, the robot will start on the "Hidden Desktop".  

 

 

How can I see what is going on, on the "Hidden Desktop"?
 

You can switch to the "Hidden Desktop" using the EXV.-Command.

For more Details see here "Switch to the Hidden Desktop".

 

 

Will I get an Exit-Code from the Executable that i have started?

 

The command EXV. will return an Exitcode (Error-level, Returncode) of the started application/command-line will be placed on the stack (TOS).

General Usage of EXV. is as simple as it can be:

 

VAR.$$LNK=?exepath\Sample Apps\TestApp_01.exe

EXV.$$LNK|c

 

You should always add the "|c" at the end of the command, or you can specify the "Cleanup" in a separate command like this:

 

VAR.$$LNK=?exepath\Sample Apps\TestApp_01.exe

EXV.$$LNK

PAU.10

EXV.|c

ENR.

 

 

The EXV. -command is blocking the script-execution as long, as the started program is alive.

If you need to do something while the application was started, use PRR. / PRE.

These commands will make the EXV. run in a parallel process and will therefore not block your script.

You can still access the return code using WRS. and GRS.

Like in this example:

 

PRR.

VAR.$$LNK=?exepath\Sample Apps\TestApp_01.exe

EXV.$$LNK

PRS.$$000

ENR.

PRE.

$$ROA=$$001

' Wait for Parallel-Process to end

WRS.$$ROA

' Get Result from EXV.

GRS.$$ROA

ENR.

 

 

 

Syntax

 

EXV.P1[|P2]

 

 

Parameter Explanation

 

P1 - [optional] Filename & Path of the executable that shall be started on the Hidden Desktop.

    If P1 is "-", just a commandline is started on the hidden desktop.(See picture below).

    This will enable you to take a look on the Hidden Desktop.

 

2015-03-20 13_08_07-Windows 7 x64 Edition - VMware Workstation

 

P2 - [optional] can be one of two Parameters "c" or "p":

    c - cleanup

    p - prepare

 

c - will cleanup some internal structures that have been needed to start the executable.

 

d - disable switching to "Hidden Desktop". This is the opposite to "p - prepare". THis will  change your system settings in a way that you can not switch to the Hidden Desktop.

 

p - prepares your system in a way that you can switch to the Hidden Desktop.

   Espeacially under Windows 8 it may not possible to switch to the "Hidden Desktop" without first using

   EXV.|p    

   

All three options (c,d and p) can be combined or used alone.

 

EXV. returns:

The Exitcode (Errorlevel, Returncode) of the started Application/comandline will be placed on the stack (TOS).

 

 

 

Example

 

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

' Example 1

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

PRR.

VAR.$$LNK=?exepath\Sample Apps\TestApp_01.exe

EXV.$$LNK

PRS.$$000

ENR.

PRE.

$$ROA=$$001

' Wait for Parallel-Process to end

WRS.$$ROA

' Get Result from EXV.

GRS.$$ROA

ENR.

ENR.'**********************************************

 

 

 

 

Remarks

 

Technical remark: EXV. uses synchronous Shell- / Create-Process-Technology and is compatible with other commands that use this technology.

EXV. will suspend the script process until the started process has ended.  The script process is not waiting, its suspended.
The suspended script process does not need any CPU resources, but also does not react on any message or whatever.

 

Generally for most tasks, the Compiler-directive '#EXV: is more useful then using the EXV.-command.

EXV. as a command will only start another task on the "Hidden desktop". The robot itself will stay on the normal user-desktop.

Using the compiler-directive '#EXV:, the robot will start on the "Hidden Desktop".  

 

 

Limitations:

 

  Hint: This Feature requires Windows Vista or higher.

 

 

See also:

 

Execute-Commands

'#EXV: - Compiler-Directive

HDC. - Hidden Desktop Control

·     Parallel Robot Operations

·     Background-Operations

·     1.7. Application and PID

·     3.3 Specialfolders

·     EXX. - Execute-Extended

·     EXE. - Execute Programm

·     EXH. - Execute-Handle

·     EXA. - Execute Asynchron

·     EXO. - Execute Open Document

·     IEF. / NEF. - If - exist - File

·     IEP. / NEP. - If-Exists-Process