@echo off setlocal enabledelayedexpansion cd /d "%~dp0" for %%i in (tools\*.exe) do ( echo %%~nxi set "OUTNAME=%%~ni" set "OUTNAME=!OUTNAME:.=-!" echo ^ > "Tools.!OUTNAME!.qrc" echo ^^^tools/%%~nxi^^^ >> "Tools.!OUTNAME!.qrc" ) pause