Kesalahan "Sintaks perintah salah" selalu muncul setiap kali saya akan menjalankan file batch ini. Sepertinya saya tidak tahu bagian mana dari skrip yang menyebabkan kesalahan ini. Ada ide?
rem Process all *.tif files in input path
pushd "%in_path%"
for %%a in (*.tif) do (
set "fileName=%%a"
rem If the YearDay in this file is the same of previous one
if "!fileName:~1,7!" equ "!yearDay!" (
rem Join this filename to previous list
set "fileList=!fileList!!fileName! "
set /A numFiles+=1
) else (
rem Merge the files in the list if there are more than 3, in the out_path leaving only TYYYYDDD.L2_LAC.Tera.tif
if !numFiles! gtr 3 (
gdal_merge.py -n 0 -a_nodata -32767 -of GTiff -o %out_path%\T!yearDay!.L2_LAC.Tera.tif !fileList!
rem Move processed files to a different directory
set "fileList=!fileList:~0,-1!"
move !fileList: =,! "%proc_path%"
)
rem And start a new YearDay and fileList
set "yearDay=!fileName:~1,7!"
set "fileList=!fileName! "
set numFiles=1
)
)
popd
Jawaban:
Mencari tahu dengan bantuan seorang teman. Saya baru saja mengganti bagian skrip ini,
dengan ini,
sumber