此內容不適用於您所偏好的語言。

此內容已顯示為其他適用語言。 您的瀏覽器可能含有可協助翻譯的套件。

Keep Command Prompt Window Open After Running LabVIEW System Exec VI

Updated Nov 24, 2020

Reported In

Software

  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Operating System

  • Windows

Issue Details

I am using the LabVIEW System Exec VI to launch an MS-DOS based program. After the program (or batch file) runs, it automatically closes the command prompt window. I want the window to stay open after the program finishes execution. Is this possible?

Solution

Yes, you can achieve this behavior by customizing the command line input of the System Exec VI as follows:
  1. Original command line input: <myDOSCommand>
Customized command line input: cmd /K <myDOSCommand>
  1. Wire a False constant to the "wait until completion?" input of the System Exec VI.
The cmd /K will open a command prompt window with the option to keep the window open after execution. 

Note: You may have to substitute cmd above with command.
 

Additional Information

To get a complete list of these command line options, open a command prompt window by going to Start » Run and typing in cmd and then type cmd /? in the window to get a listing of all the options.

Attachments