Code: Select all
::run "cmd /c """"c:\Program Files (x86)\ImageMagick-6.7.7-Q8\identify.exe"" -verbose ""<curitem>"" > c:\temp\imginfo.txt""", , 1; open "c:\temp\imginfo.txt";Here's an example of the resolved command line that actually gets executed:
Code: Select all
cmd /c ""c:\Program Files (x86)\ImageMagick-6.7.7-Q8\identify.exe" -verbose "c:\test images\crazy image.jpg" > c:\temp\imginfo.txt"1. Redirecting output of a program to a file (must run the program via cmd)
2. Running a program with cmd when the program's path has a space in it
3. Passing multiple parameters to a program run via cmd, including parameters that need to be quoted
4. Calling cmd so that it closes when finished (/c parameter)
5. Waiting for cmd to finish before proceeding to the next command in the script (, , 1 at the end of the run command)
6. Quotes quotes quotes quotes quotes quotes quotes quotes!!!!
Hopefully someone will find this useful when trying to come up with their own script to do something similar.
XYplorer Beta Club