LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Execute won't run batch file ( LabVIEW 2017)

Why won't this run the batch file when the button is pressed? I also tried the following strings for the command:

cmd /c notepad

notepad

restart

 

Nothing works!

execute.jpg

0 Kudos
Message 1 of 5
(2,864 Views)

Hi John,

 

- Is the SysExec funciton called? (Did you verify this using some debugging?)

- Does the batch file exist in the given path?

- Do you get any errors from SysExec?

- Is there some "hidden" text in the string constant? Can you set its size to content? Can you make the display mode visible?

- Which OS are you using?

 

Last, but not least:

Can you attach your VI and the batch file?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,837 Views)

Thanks for the quick reply. I've simplified the issue to a small example. Attached is a simple vi file that is supposed to start notepad when the button is pressed.

It doesn't!

 

However, the original now works. There was a space character at the beginning of the string. Good call on hidden characters -

Thanks!

(Still curious about what's wrong with the attached, though.OS is Win7 pro.)

 

 

 

0 Kudos
Message 3 of 5
(2,808 Views)

Hi John,

 

your VI works as soon as I change the switch mode of the button: Notepad starts when button is TRUE…

(On Win8.1.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,800 Views)

Your "test.vI" works fine (after changing the the mechanical action to switch when pressed)...

 

So that means your original problem lies in your batch file or how you are calling it.

 

I suggest you go through GerdW's first reply and answer his questions.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(2,792 Views)