This command works for me:
To run from cmd.exe:
convert *.jpg -set filename:f "%t.%e" "%[filename:f].png"
The same, to run from bat-file (double % instead of single):
convert *.jpg -set filename:f "%%t.%%e" "%%[filename:f].png"
Now, let's assume I have this file hierarchy:
test\
 |-- small\               <-- this is an empty folder
 |-- image1.jpg
 |-- image2.jpg
How I should modify existing script to output files in small folder, as shown below?
Current behaviour:
test\
 |-- small\
 |-- image1.jpg
 |-- image2.jpg
 |-- image1.jpg.png
 |-- image2.jpg.png
Desired behaviour:
test\
 |-- small\
      |-- image1.jpg.png
      |-- image2.jpg.png
 |-- image1.jpg
 |-- image2.jpg
I tried to use %~dp0, but with no luck currently.
 
    