<< Click to Display Table of Contents >> Navigation: 3. Script Language > Execute-Commands > Execution Commands |
MiniRobotLanguage (MRL)
EXS. Command
Execute Shell
Intention
Starts a file or document like when you click on it with the mouse. EXS. will not only start executable files. It will also start any registered file, like a office-document or text-file.
EXS. will open hyperlinks and even download-links. This will both work as expected:
EXS.http://www.heise.de/
EXS.www.heise.de/
The document will be started somehow like if you have clicked on it with the mouse.
' Open a document
EXS.?desktop\MyActions.txt
' Open a system folder, like you click on a folder-icon
EXS.?ws\
Disadvantage from that system is, that it does NOT deliver #pid# or #tid#.
EXS. is technically similar to EXF. (Execute Fast). It will however be less fast.
In result, EXS. is able to return an error code if there was a problem, while EXF. will not.
EXS. will return an error code on the TOS, if there was a problem. If there was no problem, EXS. will return a zero on the TOS.
If you plan to start a lot of executable files very fast, or if the executable that you start blocks the script when you use EXS., then prefer using EXF.
If you start a lot of executable files, EXS. is safe and slower, because it waits(/blocks the script-execution) until all internal system processes that start the file are running.
EXF. will just be very fast and start whatever you want as fast as your system can do.
EXF. unlike EXS. breaks through all API-limits (and can even crash a process if used careless). Try this example using EXS. or EXF. and see the difference.
KPN.iexplore.exe|a
FOR.$$CNT|1|20
EXS.iexplore|www.fa2.de
NEX.
STS.DUMP
MBX.Click to Close all IE's
KPN.iexplore.exe|a
ENR.
however if you want to open many TAB's in your browser, EXF. is just faster: Try this:
' Open your daily browser
EXF.http://dict.leo.org
EXF.http://www.facebook.com
EXF.http://www.heise.de/
EXF.www.fa2.de
ENR.
Syntax
EXS.P1[|P2][|P3][|P4]
Parameter Explanation
P1 - Executable or Document-Filename (can be a hyperlink)
P2 - (optional) Parameter for command-line
P3 - (optional) Path/Folder for command, if omitted current folder is used
P4 - (optional) Window Size Parameter, if omitted NORMAL is the default size
You can use the following window-size parameters for P4
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.
Error-codes from EXS.
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 - DLL is missing.
Example
'***********************************************
' Example 1 - without Windows-Parameter
'***********************************************
' Example1
DBM.2
' Vars and special folders can be used.
' Don`t wait = 100 + 3 for maximize window = 103
EXS.?desktop\MR.txt|103
DMP.
END.
'***********************************************
' Example 2 - using Windows-Parameter
'***********************************************
' Example 2
DBM.2
' Variablen und Spezialordner können verwendet werden.
: §§FIL=?desktop\MyWord.doc
EXS.§§FIL|§§WIN
DMP.
END.
Remarks
Technical remark: EXS. uses ShellExecute-Technology and is compatible with other commands that use this technology. EXS. can be blocked by a process that it has started.
EXS. may work with some of these (depending on the OS):
EXS.system.ini
EXS.control
EXS.write
EXS.pbrush
EXS.winword
EXS.excel
' Start NetMeeting (XP)
EXS.conf
etc.
EXS. 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)
EXS.control
' Will open "Control Panel\All Control Panel Items\Administrative Tools"
' XP, Win7
EXS.control admintools
' WIll open the Clipboard Viewer
' XP only
EXS.clipbrd
' Systemconsole Prompt
' XP, Win7
EXS.CMD
' NotePad
' XP, Win7
EXS.notepad
' Windows Explorer
' XP, Win7
EXS.explorer
' XP, Win7
EXS.mspaint
' Open RegEdit
' XP, WIn7
EXS.regedit
' Windows Soundrecorder
' XP only
EXS.sndrec32
' Windows System Editor
' XP only
EXS.sysedit
You can use EXS. to open folders:
EXS.?ws\
EXS.?wi\
Limitations:
EXF. does deliver #pid# or #tid#. It does not deliver an error-code in case something did not work.
See also:
• EXR. - Executer-from-Registry
• EXO. - Execute Open Document