Re: Execute Windows cmd commands within macro language
Posted by
JAMES,
gregory (SANDWELL AND WEST BIRMINGHAM HOSPITALS NHS TRUST) on
Oct 27, 2017; 8:57am
URL: http://imagej.273.s1.nabble.com/Execute-Windows-cmd-commands-within-macro-language-tp5019610p5019623.html
Thank you to all the people that replied to me publicly and privately.
I have sorted my problem so will post the solution to the ImageJ community...
The command required is indeed...
exec("cmd", "/c", "start", path);
... where 'path' is the path to the .bat file that you want to execute.
In the Windows cmd command prompt, the path is allowed to have spaces in it, but it seems (at least for my version of ImageJ) that the path is *NOT* allowed to have any spaces in it in the macro language. I find this slightly strange as I've not had this problem before. My experience is that ImageJ tends to be happy with spaces in string file paths. Perhaps someone more knowledgeable than myself could enlighten the community and explain what is happening here?
Thanks,
Greg (Birmingham, UK)
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html