Batch files are intended to avoid manual repititious tasks,
all the different resolutions can be put in another nested for
.
The renaming should be first to allow access to the ~
modifiers later
Untested:
:: Q:\Test\2019\01\15\SO_1394446.cmd
@Echo off&SetLocal EnableDelayedExpansion
Set inkscape="C:\Program Files\Inkscape\inkscape.com"
Set magick="C:\Program Files\ImageMagick-7.0.7-Q16\magick.exe"
Set "Pattern= "
Set "Replace=_"
For %%a in ("* *.svg") Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
for %%f in (*.svg) do (
for %%r in (256 128 64 48 32 24 16) Do (
%inkscape% ^
-z ^
--export-background-opacity=0 ^
--export-height=%%r ^
--export-png="%%~nf_%%rx%%r.png" ^
--file="%%~f"
)
mogrify -units "PixelsPerInch" -density 96 %%~nf_*.png
%magick% convert %%~nf_16x16.png ^
%%~nf_24x24.png ^
%%~nf_32x32.png ^
%%~nf_48x48.png ^
%%~nf_64x64.png ^
%%~nf_128x128.png ^
%%~nf_256x256.png %%~nf.ico
)