Epi Info™ User Guide

Command Reference


Analsysis Commands: EXECUTE

Description
This command executes a Windows program; one explicitly named in the command, or one designated within the Windows registry as appropriate for a document with a named file extension. This provides a mechanism for bringing up whatever word processor or browser is the default on a computer without first knowing its name.

If the pathname is a long filename, it must be surrounded in single quotes. If the command takes parameters, surround the command and the parameters with a single set of double quotes. Do not use single quotes.

Program Specific Feature
Link and Activate are not valid command names.

Syntax
EXECUTE <filename>
EXECUTE “<filename> <command-line parameters>”
EXECUTE NOWAITFOREXIT <filename>
EXECUTE NOWAITFOREXIT ‘<filename>’
EXECUTE NOWAITFOREXIT “<filename>”
EXECUTE WAITFOREXIT <filename>
EXECUTE WAITFOREXIT ‘<filename>’
EXECUTE WAITFOREXIT “<filename>”

  • The <filename> represents the path and program name for .exe (filename for registered Windows programs).
  • The <command-line parameters> represent any additional command-line arguments that the program can accept. When used, the entire string should be enclosed within double quotes.
  • When WAITFOREXIT is specified, the command and Analysis should run. When Wait for Command to Execute is not specified (non-modal), Classic Analysis should wait until the executed program closes before continuing. When EXECUTE is run modally, permanent variables are written before the command is executed, and reloaded after the command is executed.

Comments
If the name given is the name of a file rather than a program, and if the file type is associated with a Windows app, then the app will open to display the file or document. For example, since the extension .docx is associated with the Microsoft Word© app, an EXECUTE command specifying a file named “MyDocument.docx” would show the MyDocument file in the Word app.   A file with an .htm or .html extension will probably be shown in the default web browser.

Examples
Example 1: The EXECUTE command is used to start the Enter module.

EXECUTE "Enter.exe"

Example 2: The output file generated (in this case, Outbreak1.htm) is opened in the computer’s default web browser.

READ {.\Projects\Sample\Sample.prj}:Oswego 
ROUTEOUT ".\Output\Outbreak1.htm" REPLACE 
SET STATISTICS=COMPLETE 
TABLES Vanilla Ill STRATAVAR=Sex 
MEANS Chocolate Ill 
CLOSEOUT 
EXECUTE ".\Output\Outbreak1.htm"