LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a DOS commands with LabVIEW on a Windows-PC

Hi folks,
I figured, the Functions>Communication>System-Exec.VI can only call
Windows applications, but doesn't work for DOS commands (like dir, fc,
format, etc), nor is it possible to open a DOS Window.
Is there any other way to execute DOS commands, or am I missing
anything?

Ciao,
Rainer
0 Kudos
Message 1 of 2
(7,373 Views)
Hi,
To execute a DOS command with SystemExec.vi you have to use for example next inputs:
"command line" - "cmd.exe" (this means that you work in dos session)
"standard input" - "dir" + EndOfLine (in codes it looks like "dir\n")
Then in "standard output" node you will get the string with list of files in "working directory".
Don't forget to use the EOL symbol after the command you want to execute. This is the same as pressing of Enter key when you type the command in DOS mode.

Example is attached. It is in LV6.

Oleg Chutko.
Message 2 of 2
(7,373 Views)