我正在尝试设置变量来定义目录路径。出于某种原因,当我引用它时,批处理文件就像没有任何东西一样。
我的批处理文件如下......
set project_res_folder =../../Development/androidprojects/myapp/app/src/main/res
echo %project_res_folder%
magick %1 -resize 75%% %project_res_folder%/drawable-xxhdpi/%1
magick %1 -resize 50%% %project_res_folder%/drawable-xhdpi/%1
magick %1 -resize 37%% %project_res_folder%/drawable-hdpi/%1
magick %1 -resize 25%% %project_res_folder%/drawable-mdpi/%1
当我使用有效参数运行该批处理文件时,echo只会写
ECHO is on.
并且所有路径都写出来,好像project_res_folder var甚至不存在
unable to open image '/drawable-xxhdpi/metal_seekbar_thumb.png'
答案 0 :(得分:2)
删除=符号前的空格。那应该解决它。
set project_res_folder=...