RunCommand |
Top Previous Next |
Syntax - RunCommand <FileToExecute> [<WindowStyle> [<WaitType> [<TimeOut>]]] Where: <FileToExecute> is a literal string or a variable containing a literal string. <WindowStyle> is a literal string or a variable that contains a literal string of value "HIDE", "MAXIMIZEDFOCUS", "MINIMIZEDFOCUS", "MINIMIZEDNOFOCUS", "NORMALFOCUS", and "NORMALNOFOCUS". <WaitType> is a literal string or a variable that contains a literal string of value "Wait" or "NoWait." <TimeOut> is an integer or a variable containing an integer.
Description: This command is used to execute a Windows based application. The application must be able to be executed from a command prompt, a batch file, or from the Windows RUN command. Any parameters required by the application being executed must be included in the <FileToExecute> parameter. <WindowStyle> identifies the type of window that will be opened for the application to run in. If not provided, the default value for the <WindowStyle> option is MinimizedFocus.
<WaitType> determines if EMUE is to wait for the completion of the application.
<TimeOut> is the maximum number of milliseconds that EMUE is to wait for the completion of the application before EMUE terminates the processing of the script with an error. If the application finishes before the specified timeout, then EMUE will immediately continue processing. The TimeOut option only applies if the WaitType is set to WAIT, otherwise it is ignored. If not provided, the default value for the <TimeOut> option is zero, which causes EMUE to wait indefinitely for the application to finish executing.
Note: If the WAIT option is used with <TimeOut> unvalued or not included and the called application never closes, then the script will hang indefinitely.
Note: For the <FileToExecute> parameter If there are spaces or parentheses in the path or file name, then the path and file name should appear in single quotes inside of the double quotes. These single quotes will be replaced by double quotes before the application is run. If this is not done EMUE will not be able to accurately parse the command statement and the application will not execute as expected. Files that contain spaces in the path or name should be enclosed in single quotes.
Note: If the application requires that the Current Path is set in a particular configuration. The SetCurrentPath command is used to accomplish this.
Note: When running EMUE using RunCommand, NormalFocus must be used as the WindowStyle.
Sample 1: The following statement instructs EMUE to execute Microsoft Access using an existing ExportData macro for the “Database” database and wait up to 20 seconds for this to complete. RunCommand "'C:\Program Files\Office2003\Office11\MSAccess.exe' 'C:\DBs\Database.mdb' /x ExportData" NormalFocus WAIT 20000
Sample 2: The following statement runs another instance of EMUE. The first portion of the command provides the path to the EMUE executable. The second part is a command line switch to start the file automatically. See also command line switches for other options with EMUE. The final section is the path and file name of the script that should run. RunCommand "'C:\Program Files\Databound Solutions\EMUE V3\emuev3.exe' /AutoStartFile 'C:\EMUE\Test\Script1.emue3'" NormalFocus WAIT
|