转换到另一个文件夹
Convert to another folder
这个命令对我有用:
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
,但目前没有成功。
我想我明白了,但在尝试之前先备份一下:
mogrify -path small -format png *.jpg
我没有 Windows 随时可供测试,但根据您的评论尝试:
convert *.jpg -set filename:f "%%t.%%e" "small/%%[filename:f].png"
这个命令对我有用:
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
,但目前没有成功。
我想我明白了,但在尝试之前先备份一下:
mogrify -path small -format png *.jpg
我没有 Windows 随时可供测试,但根据您的评论尝试:
convert *.jpg -set filename:f "%%t.%%e" "small/%%[filename:f].png"