12-11-2015 02:23 PM
Hello,
I am trying to run a batch file in a TestStand sequence that uses Image Magick to convert BMP images to JPG images. The content of the batch file is:
for %%f in ("F:\Reports\Test Folder\Captured Images\*.bmp") do ( convert "%%f" "F:\Reports\Test Folder\Captured Images\%%~nf.jpg" )
When I run this directly from a command line prompt (Windows XP or Windows Server 2012) it works great. When I call it in TestStand using the Call Executable step I get an error:
"Invalid Parameter - Folder\Captured".
In other words, it doesn't seem to see the quotation marks and blows up on the first space. BUT, even when run from TestStand the quotation marks do appear in the CMD window echo of what it is trying to run. The echo appears to be the same whether I run it from a command prompt or TestStand, it just doesn't work in TestStand.
Anyone know why this is having a problem?
12-14-2015 02:14 PM - edited 12-14-2015 02:15 PM
Hi Raydur,
TestStand sometimes requires double quotation marks when evaluating strings. More information on that property can be found here: http://digital.ni.com/public.nsf/allkb/78D9AC8EA0C9E978862576CC007825AC
Did you try using double quotations and seeing if that helped your issue?
12-16-2015 08:17 AM - edited 12-16-2015 08:18 AM
on the path try to use \\
this is an example of a call i do to rrun the Call Executable step
"/k C:\\sikuly1.1\\runsikulix.cmd -r C:\\Tfs_Hal\Workspace\Applications\\TestStand\\WssTest\\Sikuly\\TakeScreenShot.sikuli --args "+ Parameters.PicName+" "+Parameters.PathForPic
12-17-2015 05:21 PM
Hi Sunayna,
Just to be clear, TestStand is calling a .bat file using the Call Executable step type. This passes in a path (which cannot contain quotation marks). There are no arguments (empty string). The command prompt opens and the .bat file does execute, so it is finding it properly.
The behavior is that when I run the batch file directly (from a command prompt, or just double-click on it) it works fine. When TestStand opens the command prompt and runs the batch file then the code inside the batch file complains like it is not seeing the quotes within the batch file (even though they are there and are shown when trying to execute).
To summarize:
Call the batch file manually (double-click) and it works fine.
Call it from TestStand and it executes, but the codes inside the batch file acts like it doesn't have quotation marks on the paths that contain spaces.
Very odd behavior!
12-18-2015 09:39 AM
Hi Raydur,
I agree - that is very strange! Did you try the double slashes in the path, as buton suggested? I think it might be a syntax issue you're running into here.