The LAUNCH command invokes or runs executable programs, as well as files associated with programs.
Options
|
The pipe character is needed when a file parameter, W (wait), or show mode is specified. The number of pipes needed depend on the last part of the LAUNCH command being used. If only a file is being launched and no addition portions of the LAUNCH command are being used, the pipe characters are not needed. However, if a file is being launched and only a show mode is used, then all three pipes are required.
CMD_EXPLORE
Displays the Windows Explorer from the specified folder.
CMD_FIND
Initiates a search from the specified folder.
CMD_PRINT
Prints a file to the default printer, or displays a print dialog, based upon file type.
filename.ext
The name of file which has a corresponding association registered with Windows. If the file does not exist, an error will be displayed.
filespec
The name of the file to print. Based upon the file type, the file will be sent directly to the default printer, or will display in a print dialog, If the file does not exist, or if the file is not printable, an error will be displayed.
path
Specifies the directory name.
<parameters>
To specify additional parameters associated to the launched program.
show mode
Specifies how the launched program or operation is displayed. The show modes may not be supported by some programs.
•NORMAL - launches the program in a normal window
•MINIMIZED - launches the program in a minimized window
•MAXIMIZED - launches the program in a maximized window
•HIDE - launches the program, but it is hidden from display
W
To specify the "Wait Until Finished" option.
About the LAUNCH Command
LAUNCH command is used to execute (or LAUNCH) another application or process, from within R:BASE. Based upon the extension for the file name, a corresponding program associated to it within Windows will open when launching the file. For example, launching a text file will invoke Notepad, if the program is associated to the txt file extension.. If a full path is not specified, the current search path is used.
The LAUNCH command allows for command line parameters to be specified that will be recognized by the program being launched. The launched application will start in the same directory as the executable file or in the directory referenced, if specified.
The LAUNCH command also allows you to use a "Wait Until Finished" option to specify whether or not you want R:BASE to sleep while the launched program executes or continue running. If the "Wait Until Finished" parameter "|W", (e.g. pipe and W with no space) is added to the LAUNCH command, R:BASE will sleep until the launched process completes. If the "Wait Until Finished" parameter "|W" is not specified, the launched process is executed in its own thread, and the R:BASE will continue to execute.
The number of pipes needed depend on the last part of the LAUNCH command being used. If only a file is being launched and no addition portions of the LAUNCH command are being used, the pipe characters are not needed. However, if a file is being launched and only a show mode is used, then all three pipes are required.
Launch Command Features:
•LAUNCH command is supported in EEPs
•If a folder path, file name, or parameter contains spaces, double quotes (") must be added. If a folder/file contains commas, single quotes must be added.
•The LAUNCH command will execute any windows program as long as it is installed and the file extension is associated within the operating system.
•There is no longer a need to use the ZIP OUT command or run batch files, etc.
Examples
Example 01 (Invokes a VBScript to demonstrate how to access Excel using the Windows Script Host):
LAUNCH charts.VBS
Example 02 (Invokes the PDF reader program on the computer and displays the file):
LAUNCH MyDoc.PDF
Example 03 (Invokes program associated with text files, e.g. Notepad, and displays the text file in a maximized window. Three pipes are required as the "show mode" parameter is specified.):
LAUNCH c:\mydocs\ReadMe.txt |||MAXIMIZED
Example 04 (Invokes program associated with text files with the "Wait Until Finished" option for R:BASE to sleep in the background. The text file must be closed in order to give control back to R:BASE. Notice the two pipe characters with no spaces after the file name. The first pipe is listed with no parameters and no space, while the second pipe is for the "Wait Until Finished" option.):
LAUNCH ReadMe.txt||W
Example 05 (Launches Windows Explorer and displays the contents of the C:\RBTI folder):
LAUNCH CMD_EXPLORE|C:\RBTI
Example 06 (Launches Windows Explorer and displays the contents of the folder. As the path contains a comma, enclose the string in single quotes.):
LAUNCH 'CMD_EXPLORE|C:\Program Files (x86)\Parchment Products, Inc'
Example 07 (Initiate a search from the F:\Data folder):
LAUNCH CMD_FIND|F:\DATA
Example 08 (Prints the ReadMe.txt file to the default printer):
LAUNCH CMD_PRINT|C:\ReadMe.txt
Example 09 (Invokes MS Word with TestFile.DOC running the MyMacro macro. The command will invoke MS Word with the document using MyMacro as a main window while R:BASE sleeps in the background. Word must be closed in order to give control back to R:BASE. As the folder path contains spaces, double quotes (") are added.):
LAUNCH 'winword|"C:\Word Documents\TestFile.DOC" "/myMacro"|W'
Example 10 (Prints the OrderForm.pdf document):
LAUNCH CMD_PRINT|N:\Sales\OrderForm.pdf
Example 11 (Sends an automated email. The command will launch the default email program on the computer with the To:, Subject, and Body fields populated.):
SET VAR vMailTo TEXT = NULL
SET VAR vContID INTEGER = 1010
SELECT ('mailto:'+ContEMail+'?subject=Hello&body=Contact Us') +
INTO vMailTo INDIC IvMailTo FROM Contact WHERE ContID = .vContID
LAUNCH .vMailTo