@echo off mkdir out for %%i in (*.tif) DO ( convert -units pixelsperinch %%i -resample 150 out\%%i ) for %%i in (*.png) DO ( convert -units pixelsperinch %%i -resample 150 out\%%i )