LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec.vi do not execute a command with correct syntax. "Error 2 occurred at System Exec.vi"

Solved!
Go to solution

Hello all!!

 

I`m trying to execute a command to system using the System Exec.vi

 

The command is:

 

 

start /max chrome "http://www.ford.com"

This command works proprely when I run it directly from Prompt command but when using LabVIEW through System Exec.vi it gives the error:

 

 

Error 2 occurred at System Exec.vi. Command was "start /max iexplore "http://www.google.com"

Possible reason(s):
LabVIEW: Memory is full.
=========================
NI-488: No Listeners on the GPIB.

 

Block diagram image:

Capture.PNG

someone could help me with that?

 

0 Kudos
Message 1 of 9
(8,286 Views)
Solution
Accepted by topic author clebermarques

Prepend cmd /c, i.e. your command line should look like this:

cmd /c start /max chrome "http://www.ford.com"
Message 2 of 9
(8,274 Views)

Error 2 is misleading. System Exec.vi simply does not find the EXE file you reference.

Passing 'C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com' as command line to System Exec.vi works on my system.

 

EDIT: Sorry, cannot remove that stupid hyperlink as Lithium seems to automatically add the hyperlink once posting.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 9
(8,264 Views)

Norbert_B escreveu:

Error 2 is misleading. System Exec.vi simply does not find the EXE file you reference.

Passing 'C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com' as command line to System Exec.vi works on my system.

 

EDIT: Sorry, cannot remove that stupid hyperlink as Lithium seems to automatically add the hyperlink once posting.


Tks Norbert. The disadvantage of your solution is about compatibility and repeatability to operational systems with language different of english without edit the code just befause you have specified the absolute (full) path to the program.

 

However, tks for replying!

0 Kudos
Message 4 of 9
(8,243 Views)

@clebermarques wrote:
[...] operational systems with language different to english without changes in the code once you have specified the absolute (full) path to the program.

Point taken. However, as of Windows 7, the paths for installed software should always be english. The OS only changes indication in the file explorer if language setting is not english.

But you are correct that dan_u's solution is far better.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 9
(8,233 Views)

Hi marques,

 

AFAIK the command shell only knows about English names of the standard folders:

check.png

The Explorer shows German folder names while DIR in the command shell gives English folder names…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(8,231 Views)

And in addition to GerdWs first reply it is useful to have a look on all "cmd.exe"- options with

"cmd /?" in the console- window.

Greets, Dave
0 Kudos
Message 7 of 9
(8,219 Views)

@clebermarques wrote:

Norbert_B escreveu:

Error 2 is misleading. System Exec.vi simply does not find the EXE file you reference.

Passing 'C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com' as command line to System Exec.vi works on my system.

 

EDIT: Sorry, cannot remove that stupid hyperlink as Lithium seems to automatically add the hyperlink once posting.


Tks Norbert. The disadvantage of your solution is about compatibility and repeatability to operational systems with language different of english without edit the code just befause you have specified the absolute (full) path to the program.

 

However, tks for replying!


You can use %Programfiles(x86)%\Internet Explorer\iexplore.exe  to use the current system path.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 9
(8,196 Views)

FYI - I googled "labview error 2 system exec" and this was the very first hit:

http://digital.ni.com/public.nsf/allkb/EA1600EBA422E97286256AA20073C616

 

You could've saved ten minutes by asking google first.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 9 of 9
(8,179 Views)