cd %1 mkdir ImageFolder for /f "delims=" %%A in ('dir *.dot /b /a-d-h-s') Do (dot -Tpng %%A -o "ImageFolder/%%~nA.png")