Jump to content
Brainiac

Running .bat file with labview

Recommended Posts

Hi everyone,

It's all said in the title.

I wanna run a .bat file with Labview,  i have used the system exec Vi but it didn't work. 

However when i run the script directly, it works. Can u help me with this issue

Attached, my code

thanks in advance

Capture.PNG

Share this post


Link to post
Share on other sites

Also, you use the wrong slash, it should be /

 

Share this post


Link to post
Share on other sites

thanks for the answers,

I've have done some modifications but i have nothing in the output indicator.

attached a photo of the modifications

Capture1212.PNG

Share this post


Link to post
Share on other sites

Your file doesn't exist, or you typed it wrong.  I just did a test where I made a batch file with ping localhost as the only thing in the file then did the same thing you did and it worked.  I'd suggest putting an output on your error, and Standard Error to see if it returns anything like file not found.  Also you may want to test small with a batch file like dir or ping.

Share this post


Link to post
Share on other sites

I remember that I had to change my code using the "cmd /c" when changing over to Win10 from Win7.
Before I didn't have the "working directory" wired instead I specified the full path in the command. e.g. cmd /c "c:\Temp\file.bat"
Are you running WIn10?

Share this post


Link to post
Share on other sites

@Brainiac did you solve this in the end?

The code below shows how I do it, this works completely fine for me on Windows 7..10.

The Generation Batch File is the complete path on disk, I don't use the Working Directory input.

 

image.png.daffbefa9e654e9e208e56ba4ade9b4b.png 

  • Like 1

Share this post


Link to post
Share on other sites

The only thing to add to Neil is that the Wait Until Completion should be True if you are going to read the standard output after it is complete.

Share this post


Link to post
Share on other sites
18 minutes ago, hooovahh said:

The only thing to add to Neil is that the Wait Until Completion should be True if you are going to read the standard output after it is complete.

Indeed.

In my circumstance though, I don't really care too much for the output, I have some downstream code that waits a bit and checks for correct generation of a PDF file I am creating. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.