Here is a solution as windows batch script, maybe it'll help: set in_path=path_to_stored_hdfs set out_path=path_to_proccessed_ones/ md %out_path% cd %in_path% FORFILES /m *L2_LAC*.hdf /C "cmd /c gdalwarp -geoloc -t_srs "proj=longlat +datum=WGS84" -te 113.205 1.120 157.105 2.005 @path %out_path%@fname.tif" Where `/m` is a mask to match desired filenames - for further details: http://ss64.com/nt/forfiles.html Looking at your code I understand you've set *GDAL* path in system so gdalwarp should work. Hope it helps!