@Echo off setlocal ENABLEDELAYEDEXPANSION echo. echo This script runs through all the .svg files in the folder within which this file is contained and outputs an optimized version to the 'out' folder here... :: echo (type q to quit at any question) echo. :: count how many files we need to convert before converting! set /a total=0 for /R %%i in (*.svg) do ( if not exist %%~di%%~piout mkdir %%~di%%~piout set /a total=total+1 ) echo Conversion started. Will do %total% file(s). echo. for /R %%i in (*.svg) do ( set /a count=count+1 echo. echo %%i -^> %%~di%%~piout\%%~ni.%outputType% ^[!count!/%total%^] echo %%~ni echo. :: requires python package: https://github.com/scour-project/scour scour -i %%~ni.svg -o %%~di%%~piout\%%~ni.svg --enable-viewboxing --enable-id-stripping --enable-comment-stripping --shorten-ids --indent=none )