Open With does not work with .bat files and %1 style arguments

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

Post Reply
golemus
Posts: 65
Joined: Mon Dec 23, 2024 8:35 am

Open With does not work with .bat files and %1 style arguments

Post by golemus »

issue1: .bat file arguments don't work with Open With dialogue
issue2: "%~n1-R.mp4" style argument does not work either (it works inside .bat file)





This is content of mp4-rot.bat
ffmpeg -i %1 -metadata:s:v rotate="%2" -codec copy "%~n1-R.mp4"

Screenshot 2025-02-21 070855.png
User avatar
user0
XnThusiast
Posts: 2411
Joined: Sat May 09, 2015 9:37 am

Re: Open With does not work with .bat files and %1 style arguments

Post by user0 »

does it work in other apps with similar 'Open with' functionality: ImageGlass, FastStone, Imagine, etc?
golemus
Posts: 65
Joined: Mon Dec 23, 2024 8:35 am

Re: Open With does not work with .bat files and %1 style arguments

Post by golemus »

user0 wrote: Fri Feb 21, 2025 6:39 am does it work in other apps with similar 'Open with' functionality: ImageGlass, FastStone, Imagine, etc?
In faststone the .bat file worked so I didn't have to put commands directly to the dialogue.
User avatar
michel038
XnThusiast
Posts: 1468
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Open With does not work with .bat files and %1 style arguments

Post by michel038 »

I tried this :

1) Create test.bat containing :

Code: Select all

@echo off
echo start
echo : %1 : %2 : %3 :
echo stop
pause
2) Create a "Open with ..."
Name = test,
Path = C:\my_own_path\test.bat
Arguments = A "B C D"

3) Select a jpg file, > Open with > test
I get a cmd window showing my 3 arguments:

Code: Select all

start 
: "C:\my_filepath\file.jpg" : A : "B C D" :
stop
... quotes are added to the full file name
Post Reply