JMurfitt
JMurfitt

Reputation: 1

Unexpected error when running batch file

I am trying to batch process several files with a very simple batch file, however, every time that I run the .bat I get \MODIS\MOSIAC\2000\*mos.hdf was unexpected at this time

I have tried various fixes for quoting issues but nothing seems to work.

The full code is as follows

FOR %i IN (E:\MODIS\MOSIAC\2000mos\*mos.hdf) DO resample -p (E:\MODIS\MODISRepro\OntarioReproject2000.prm) -i %i -o %i.tif

What could be a possible fix for this?

Upvotes: 0

Views: 49

Answers (1)

Jim Davis
Jim Davis

Reputation: 5290

Within a batch file you need to double-up the % signs on %x variables:

FOR %%i IN (E:\MODIS\MOSIAC\2000mos\*mos.hdf) DO resample -p (E:\MODIS\MODISRepro\OntarioReproject2000.prm) -i %%i -o %%i.tif

Upvotes: 2

Related Questions