Page 1 of 1
					
				Open With does not work with .bat files and %1 style arguments
				Posted: Fri Feb 21, 2025 5:11 am
				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"
 
			 
			
					
				Re: Open With does not work with .bat files and %1 style arguments
				Posted: Fri Feb 21, 2025 6:39 am
				by user0
				does it work in other apps with similar 'Open with' functionality: ImageGlass, FastStone, Imagine, etc?
			 
			
					
				Re: Open With does not work with .bat files and %1 style arguments
				Posted: Fri Feb 21, 2025 12:29 pm
				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.
 
			 
			
					
				Re: Open With does not work with .bat files and %1 style arguments
				Posted: Fri Feb 21, 2025 5:42 pm
				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