LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

returned value from batch file

HI

I am calling bath file from CVI (win os):

int p_f= system ("C:\\Program Files\\BurnInTest\\_1.bat ");

when _1.bat call to another program, this program return 1 or 0.

 

After 'system' command, p_f always zero (its mean system command had no errors), but i want return value.

I try 'EXIT 5' (return 5) directly from _1.bat and still read 0

0 Kudos
Message 1 of 3
(3,414 Views)

This old thread may give you some idea:

using "cmd /c net name" with LabWindows cvi and get the answer to the cvi variables

A little note on the situation with modern releases of the OS: if you install your app in Program Files folder you may not able to create a file in the application folder and write to it, so it may be better to put the output file in another folder where you have write access.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,378 Views)

My solution, in the END:

For pass writhe 1 to text file and 0 for fail.

The i read this text file from my programm

0 Kudos
Message 3 of 3
(3,203 Views)