Site Map   
Home   
 
 

 

 

Functions: System - Task control

 

 

 
Exec
Launches an application with or without arguments.
Kill
Kills a process or application connected to a named window.
ExecScriptCommand
Executes a single script command internally.
LaunchScript
Launches a new daVinci process for execution of a script file.
OpenFile
Opens a file using the associated application, or launches it if it has an
.exe extension.
ExecVbScript
Executes
VBScript code that uses internal variables for both input and output values.
OpenWebPage
Opens a web page (local or downloaded from the Web) using the default Internet browser.
 
 

(1)

Exec  
 
Command: Exec( <filename> [ <command-line> ] )
Description: Launches an application with or without arguments.
Keywords: None.
Arguments: <filename>: Absolute or relative path to the file to be launched.
<
command-line>: Command line containing all arguments to be passed to the launched application.
Comments: If one or several arguments are to be enclosed in-between double-quotes, you will have to embed the double-quotes in the arguments string (see example below).
Examples: Exec( "C:\Temp\my-app.exe" )

# Notepad does not require the filename to be embedded in between double-quotes
Exec( "C:\Windows\notepad.exe" "C:\Temp\my notes.exe" )

# Other applications may require double-quotes
Exec( "C:\Windows\app.exe" "-d -f |"C:\Temp Files\temp.cfg|"" )
 
  Back to top of page»  

(1)

Kill  
 
Command: Kill( [..]<window-title>[..] )
Description: Kills a process or application connected to a named window.
Keywords: None.
Arguments: [..]<window-title>[..]: Complete or part of the title or caption of the window to be killed.
Comments: .
Examples: Kill( "info.txt - Notepad" )

Kill( "..Notepad" )
 
  Back to top of page»  

ExecScriptCommand  
 
Command: ExecScriptCommand( <script-command> )
Description: Executes a single script command internally.
Keywords: None.
Arguments: <script-command>: Script command to be executed.
Comments: .
Examples: ExecScriptCommand(
   "ShowMessage( |"Message Title|" |"Headline|" Message( |"Simple message text...|" ) )"
)
 
  Back to top of page»  

LaunchScript  
 
Command: LaunchScript( <script-file-path> [ ArgList( <argument-1> [ <argument-2> [ ... ] ] ) ] [ Wait( [ <timeout> ] ) ] )
Description: Launches a new daVinci instance for execution of a script file.
Keywords: ArgList: Defines a list of arguments to be passed to the launched daVinci process.
Wait: Makes the application to wait until the execution of the launched script is terminated before continuing.
Arguments: <script-file-path>: Path to the script file to be executed.
<
argument-n>: Argument to be passed to the new daVinci instance (up to 9 arguments may be passed).
<
timeout>: Timeout time in seconds (default is 5 sec.).
Comments: Up to 9 arguments may be passed to the launched script, in which they are referred to as @1..@9.
Even with synchronous execution (
Wait() defined) there is no return value from the executed script.
Examples: LaunchScript( "C:\Script Files\do-something.txt" )

LaunchScript( "do-something.txt" ) ArgList( "Stock value:" "345.67" ) Wait )

LaunchScript( "C:\Script Files\do-something.txt" ) Wait(120) )
 
  Back to top of page»  

(1)

ExecVbScript  
 
Command: ExecVbScript( <script-code> [ VarList( <variable-1> [ <variable-2> [ ... ] ] ) ] [ Wait( [ <timeout> ] ) ] )
Description: Executes VBScript code that uses internal variables for both input and output values.
Keywords: VarList: Defines a list of variables which will be used in the launched VBScript code.
Wait: Makes the application to wait until the execution of the launched script is terminated before continuing.
Arguments: <script-code>: VBScript code to be launched.
<
variable-n>: Variable to be used in the VBScript code, both for input and output.
<
timeout>: Timeout time in seconds (default is 5 sec.).
Comments: Up to 99 variable names may be passed to the launched script, in which they are referred to by using their pure names (without the '@' prefix).
It is recommended to enclose the entire VBScript code in between '«' and '»' characters, in order to avoid conflict with reserved characters (like '"', '&', '%' and so on), which may cause string conversion when the statement is interpreted.
On the other hand, if this is the intention and the delimiters  '«' and '»' must be omitted, all reserved characters will need to be preceded by a '|' sign (see the examples below).
Examples: Set( @Message "If you press 'OK' the answer will be 1, else 2." )
Set( @ScriptCode "«Result = MsgBox (Message, 65, "VBScript Example")»" )

ExecVbScript( @ScriptCode VarList( @Message @Result ) Wait(20) )
ShowMessage( "Testing VBScript" "" Message( "Answer: %Result%" ) )

#---------------------------------------------
Set( @Message "Just press a button, no answer will be returned." )
Set( @ScriptCode "Result = MsgBox (|"%Message%|", 65, Title)" )

ExecVbScript( @ScriptCode )  # Execution continues immediately
 
  Back to top of page»  

OpenFile  
 
Command: OpenFile( <filename> )
Description: Opens a file using the associated application, or launches it if it has an .exe extension.
Keywords: None.
Arguments: <filename>: Absolute or relative path to the file to be open/launched.
Comments: Corresponds to double-clicking on the file icon in Windows Explorer.
Examples: OpenFile( "C:\Temp\My Notes.txt" ) # Launches the default text editor

OpenFile( "C:\Temp\My Song.mp3" )  # Launches the default media player
 
  Back to top of page»  

OpenWebPage  
 
Command: OpenWebPage( <url> )
Description: Opens a web page (local or downloaded from the Web) using the default Internet browser.
Keywords: None.
Arguments: <url>: URL (with or without the http:// prefix) pointing to the addressed web page.
Comments:  
Examples: OpenWebPage( "http://www.google.com" ) # Opens the page in the default browser
 
  Back to top of page»  

   Symbols: Runs on standard PCs Runs on mobile units (Pocket Pc) Runs on Windows servers
(1) Available in the Advanced Server application only.  
Produced by Carso   |  Last update: 2009-06-02