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 /d %in_path%
FORFILES /m *L2_LAC*.hdf /C "cmd /c gdalwarp -geoloc -t_srs EPSG:4326 -te 113.205 1.120 157.105 2.005 HDF4_SDS:hdf:@file:01 %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!