Jump to content

Running .bat file with labview


Brainiac

Recommended Posts

Posted

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

Posted

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.

Posted

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?

Posted

@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
Posted
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. 

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.