Brainiac Posted September 9, 2019 Report Share Posted September 9, 2019 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 Quote Link to comment
Neil Pate Posted September 9, 2019 Report Share Posted September 9, 2019 Looks like you might have a space between the \ and the c in your string Quote Link to comment
Gribo Posted September 9, 2019 Report Share Posted September 9, 2019 Also, you use the wrong slash, it should be / Quote Link to comment
Brainiac Posted September 9, 2019 Author Report Share Posted September 9, 2019 thanks for the answers, I've have done some modifications but i have nothing in the output indicator. attached a photo of the modifications Quote Link to comment
hooovahh Posted September 9, 2019 Report Share Posted September 9, 2019 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. Quote Link to comment
MikaelH Posted September 11, 2019 Report Share Posted September 11, 2019 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? Quote Link to comment
Brainiac Posted September 11, 2019 Author Report Share Posted September 11, 2019 @MikaelH yes , i'm running Windows 10 Quote Link to comment
Neil Pate Posted September 13, 2019 Report Share Posted September 13, 2019 @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. 1 Quote Link to comment
hooovahh Posted September 13, 2019 Report Share Posted September 13, 2019 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. Quote Link to comment
Neil Pate Posted September 13, 2019 Report Share Posted September 13, 2019 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.