【发布时间】:2018-06-05 02:06:30
【问题描述】:
这个命令对我有用:
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"
现在,假设我有这个文件层次结构:
test\
|-- small\ <-- this is an empty folder
|-- image1.jpg
|-- image2.jpg
我应该如何修改现有脚本以输出小文件夹中的文件,如下所示?
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
我尝试使用%~dp0,但目前没有运气。
【问题讨论】:
-
尝试发布非工作脚本。
标签: batch-file cmd imagemagick image-manipulation imagemagick-convert