LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I have LabView run an exe file?

I am trying to setup a VI that will open and run an external exe file. Any suggestions would be greatly appreciated.
0 Kudos
Message 1 of 16
(5,847 Views)
Gto the Communication palette and select System Exec.vi.
Message 2 of 16
(5,847 Views)
Craig...not certain of the location of your executable, but if you mean external to Labview but local to your PC, then try the 'System Exec' vi in Functions > Communication palette. It calls the winexec command were you can execute system level commands. Else, reply back to clarify.
Doug
Message 3 of 16
(5,847 Views)
Thanks for the help. 'System Exec' worked great, but now I am facced with the EXE remaining open after it has run. Any ideas on how to close it when finished?
0 Kudos
Message 5 of 16
(5,847 Views)
Your EXE is probably waiting for some sort of user input (like a "quit" command). There are keyboard utilities available that will help you do this. George Zou has some at http://gtoolbox.topcool.net/. You could also try doing a search of the Developer Exchange.
0 Kudos
Message 6 of 16
(5,847 Views)
Dennis - Good tip & link,
thanks, Doug
0 Kudos
Message 9 of 16
(5,847 Views)
Try using System Exec.vi. In LabVIEW 6, it's under Functions >
Communication

"Craig C" wrote in message
news:506500000008000000192A0000-998975444000@exchange.ni.com...
> I am trying to setup a VI that will open and run an external exe file.
> Any suggestions would be greatly appreciated.
Message 4 of 16
(5,847 Views)
Maybe someone else can correct me if I am wrong, elaborate if I am partway there, or slap me if I am way off base, but to execute an exe, you do call the system exec, but have to use the command.com commandline formatting. This may have been for a batch file, I can't quite remember.

I do know a way to test it though. The system exec is the exact same thing as the "Run" on your start menu, assuming that you are using labVIEW for windows. Try your command there. If it works, then simply cut and paste on the input to the system exec.

Good luck, and let us know how you do.
0 Kudos
Message 7 of 16
(5,847 Views)
Maybe someone else can correct me if I am wrong, elaborate if I am partway there, or slap me if I am way off base, but to execute an exe, you do call the system exec, but have to use the command.com commandline formatting. This may have been for a batch file, I can't quite remember.

I do know a way to test it though. The system exec is the exact same thing as the "Run" on your start menu, assuming that you are using labVIEW for windows. Try your command there. If it works, then simply cut and paste on the input to the system exec.

Good luck, and let us know how you do.
0 Kudos
Message 8 of 16
(5,847 Views)
Labviewguru,

I've used system exec both ways... I had to use the command.com
technique when I ran the DOS "date" command and the DOS "time"
commands. But, I've also just fed it the name of the exe file w/
command line arguments, i.e. "NOTEPAD.EXE /p TEST.txt" when I wanted to
use notepad to printout a file...

Like your posts...

Later,
Bill

p.s. In both cases I set "Wait Until Complete" false and "Run
Minimized" true... so they ran totally in the background and closed
themselves when complete.

Labviewguru wrote:
>
> Maybe someone else can correct me if I am wrong, elaborate if I am
> partway there, or slap me if I am way off base, but to execute an exe,
> you do call the system exec, but have to use the command.com
> commandline formatting. This may h
ave been for a batch file, I can't
> quite remember.
>
> I do know a way to test it though. The system exec is the exact same
> thing as the "Run" on your start menu, assuming that you are using
> labVIEW for windows. Try your command there. If it works, then
> simply cut and paste on the input to the system exec.
>
> Good luck, and let us know how you do.
0 Kudos
Message 10 of 16
(5,848 Views)