Showing results for 
Search instead for 
Did you mean: 

Run an executable with static user inputs in Labview


I need to run an executable called RawPack.exe in Labview that uses consistant user inputs.


For example, the exe will always ask the following questions in the cmd window:
1. Adapter number?

2. Sender IP Address?

3. Sender Port?

4. Receiver IP Address?

5. Reciever Port?


The resonse to these will always be:
1. 3


3. 5001


5. 5001


I can use System Exec.Vi to run the executable but I would like the the program to automatically put in those inputs when prompted.
How can I do this?


Alternatively, I have made an input file called "input.txt" that lists the 5 inputs.

By typing "RawPack.exe < input.txt" in the cmd window, the program runs automatically without needing user prompts.
I tried this in the System Exec.Vi "command line" but it gives me an error saying file is not found.


Please help.

0 Kudos
Message 1 of 5

Try putting a CMD /C in front of it.


ie. "cmd /c RawPack.exe < input.txt"

0 Kudos
Message 2 of 5

I did, that doesn't work.

0 Kudos
Message 3 of 5

You may want to use a virtual keuboard to generate keystrokes. Take a look at this: 🙂 and here is the Windows API information 


This may also Help: 🙂

Sam S
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5

Create a BAT file that works. Then call this BAT file from System Exec.

I had to do this unreleated to LabVIEW and I don't remember the issues why...



Message 5 of 5