Launching a VI from the Command Line

To launch a VI from the command line (such as by selecting Start»Run on Windows), use the following syntax:

c:\labview\labview.exe <path to VI relative to the labview directory>

Note Note  You must close LabVIEW before launching a VI from the command line.

For example, to launch readme.vi in c:\labview\examples, use the following command:

c:\labview\labview.exe examples\readme.vi

If the VI is located in a directory other than the labview directory, you must specify the full path to the VI, as shown in the following example:

c:\labview\labview.exe c:\coolapp\mycool.vi

If a directory in the path contains spaces, you must enclose the path in quotation marks, as shown in the following example:

c:\labview\labview.exe "c:\cool application\mycool.vi"

If the VI is in an LLB, use one of the following ways:

You also can pass LabVIEW-defined or user-defined arguments when you launch LabVIEW from the command line. To pass user-defined arguments in the command line, enter two hyphens (--) surrounded by spaces before the set of user-defined arguments. LabVIEW does not use any arguments after the two hyphens to launch labview.exe. LabVIEW passes the arguments after the two hyphens to the block diagram of the VI you launch. Use the Application:Command Line Arguments property to read the user-defined command-line arguments passed when LabVIEW launches.

For example, to launch mycool.vi and pass user-defined arguments, use the following command:

c:\labview\labview.exe c:\coolapp\mycool.vi -- 1000 sine

On the block diagram of the mycool.vi, use the Application:Command Line Arguments property to read the 1000 and sine arguments you passed and handle the values. For example, you can wire the argument values to the case selector on a Case structure.