Using Open with... to send an image to a batch file
Posted: Sat Jun 23, 2018 8:07 pm
I'm trying to configure a batch file as one of the programs to open an image with, but it's not launching as expected. It appears XnView isn't passing the image name correctly to CMD. My xnview.ini is as follows:
OpenWith=C:/Windows/System32/cmd.exe
OpenWithName=Test
OpenWithParam="/c c:\tools\test.cmd"
In theory this should launch CMD.EXE, call my batch file, and pass it the image name as a parameter. But my batch file currently just reads "ECHO %1 %2 %3" and shows that no parameters are being passed to it.
If I call the following from the command-line it works, so it's not a problem with CMD.EXE, it can only be that XnView isn't passing the image name at the end of the command-line:
cmd /c c:\tools\test.cmd "g:\images\test image.jpg" <-- this works
Any way I can change the syntax in my xnview.ini to make this work? TIA for any suggestions!
OpenWith=C:/Windows/System32/cmd.exe
OpenWithName=Test
OpenWithParam="/c c:\tools\test.cmd"
In theory this should launch CMD.EXE, call my batch file, and pass it the image name as a parameter. But my batch file currently just reads "ECHO %1 %2 %3" and shows that no parameters are being passed to it.
If I call the following from the command-line it works, so it's not a problem with CMD.EXE, it can only be that XnView isn't passing the image name at the end of the command-line:
cmd /c c:\tools\test.cmd "g:\images\test image.jpg" <-- this works
Any way I can change the syntax in my xnview.ini to make this work? TIA for any suggestions!