NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I get error -17500 when calling a batch file using the call executable step type?

I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?
0 Kudos
Message 1 of 4
(3,496 Views)
John -
It appears that the difference between the two paths is the failing one has a space in one of the directory name segments. I tried both

C:\temp\temp longname\test.bat
and
C:\temp\templongname\test.bat

and both worked fine for TestStand 1.0.2 and 2.0.1.

Can you add PAUSE commands and ECHO ON commands to the batch file to see if it running and if so where it is failing?

Scott Richardson
Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 4
(3,496 Views)
It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.
0 Kudos
Message 3 of 4
(3,496 Views)
In order to support 16 bit apps, the call executable step type code only uses the commandline parameter to the function CreateProcess. If the code wraps the filename with quotes before appending the arguments, the problem should go away. I will look into updating TestStand in a future to fix this...

Scott Richardson (NI)
Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 4
(3,496 Views)