The following works in Command Line but the second one fails in the Batch script. By fails I mean that it exit the .Bat immediately. Does not even stop at a PAUSE immediately following the FOR /F
...... executing line.
Console:
FOR /F "TOKENS=1 delims=" %I IN ('Dir *.Properties /B') DO (If NOT EXIST ..\Working\%~nI_ru.properties copy %~nI.properties ..\New_Files\%~nI_ru.properties)
Batch file:
FOR /F "TOKENS=1 delims=" %%I IN ('Dir *.Properties /B') DO (If NOT EXIST ..\Working\%%~nI_ru.properties copy %%~nI.properties ..\New_Files\%%~nI_ru.properties)
It is comparing two software version releases and selecting those 'new' property files available and copying them to a New_File directory with filename change.
ThisIsANewFile.properties is copied as ThisIsANewFile**_ru**.properties i.e. _ru
appended to the FileName
Thanks to anyone who knows what I've done wrong,