Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
8 ratings:
 2.87 out of 5   

System Exec.vi Does Not Execute Commands that Use Redirection



Primary Software: LabVIEW Development Systems>>Full Development System
Primary Software Version: 5.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems

Problem:
I want to run a Windows utility (C:\winnt\system32/rasdial) using the System Exec VI in LabVIEW. By default, this utility will display its output on the screen, but I want to use the > character to redirect the output to a file (for example, C:\winnt\system32/rasdial...>rasdial.txt). This works fine from a DOS prompt, and it works fine in LabVIEW without the redirection, but when I try to use the path with the redirection in LabVIEW, I get no output at all.

Solution:
This is more of a Windows issue than a LabVIEW issue. If you use this command with the Windows Run feature (Start » Run), you will see the same behavior that you saw in LabVIEW (it works without the redirection to file, but not with it). The solution is to create a batch file that runs the utility with the redirection, and then use the System Exec VI to call the batch file. See the links below for more information on creating a batch file.

Related Links:
Knowledge Base 2WCDS3DI: Creating a Batch File
Knowledge Base 20M9IIHU: After Running a Batch File with the System Exec VI, the Command Window Remains Open


Attachments:





Report Date: 09/29/1999
Last Updated: 07/08/2012
Document ID: 1PS7P9BG

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit