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!
Using Open with... to send an image to a batch file
Moderators: XnTriq, helmut, xnview
Re: Using Open with... to send an image to a batch file
Here is an exemple
I created a bat file (test.bat) containing :
in Xnviewmp, configure "Open with" only with test.bat (name this function Text-list), without parameters
Then , right click on a text file , select Text-list, will diplay the content of the file
I created a bat file (test.bat) containing :
Code: Select all
echo Hello
type %1
pause
Then , right click on a text file , select Text-list, will diplay the content of the file
Catalogage avec XnviewMP : https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Re: Using Open with... to send an image to a batch file
another exemple
if my ".bat" file contains :
"Open with" ... will open selected picture with Photofiltre (It's a picture editor)
if my ".bat" file contains :
Code: Select all
"C:\Program Files (x86)\Photofiltre6\photofiltre.exe" %1
Catalogage avec XnviewMP : https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Re: Using Open with... to send an image to a batch file
Thanks michel038, I did some more digging and this is caused by an issue with the file associations on my PC, it's unrelated to XnView. I'll take my question to a PC forum to make some more progress, I appreciate your willingness to help, cheers!