I'm working with a batch file that doesn't process when executed, but does when pasted into command window:
When executed it spawns a window then closes the window with no output files. When pasted into a command window it creates 3 files as expected.
Any assistance is greatly appreciated!
Code:
SET directory=C:\Uwharrie
SET file=Limits.csv
FOR /F "tokens=1,2,3,4,5,6,7 delims=," %G IN (%directory%\%file%) DO (
IF "%H"=="00118" (ECHO %G,%H,%I,%J,%K,%L,%M >>%directory%\Limits_00118.csv)
IF "%H"=="00196" (ECHO %G,%H,%I,%J,%K,%L,%M >>%directory%\Limits_00196.csv)
IF "%H"=="00125" (ECHO %G,%H,%I,%J,%K,%L,%M >>%directory%\Limits_00125.csv))
When executed it spawns a window then closes the window with no output files. When pasted into a command window it creates 3 files as expected.
Any assistance is greatly appreciated!