@echo off
Title %~nx0
SetLocal EnableExtensions EnableDelayedExpansion
rem ---------------------------------------------------------------
rem Search ReplaceStr.exe in CRW_DAQ_SYS_PATH, then add him to PATH
rem ---------------------------------------------------------------
for %%i in (ReplaceStr.exe) do (path %%~dp$CRW_DAQ_SYS_PATH:i;%path%)
rem ---------------------------------------------------------------
rem Use file.gen | ReplaceStr "from" "to" .. &gt; dest.cfg replacement
rem to generate a config files from source file-generator file.gen. 
rem ---------------------------------------------------------------
type Demo.cfg.gen ^
 | ReplaceStr "$DemoDevice$" "&DemoDevice1" ^
 | ReplaceStr "$DemoTag$" "DemoTag1" ^
 > Demo.cfg
type Demo.cfg.gen ^
 | ReplaceStr "$DemoDevice$" "&DemoDevice2" ^
 | ReplaceStr "$DemoTag$" "DemoTag2" ^
 >> Demo.cfg
rem ---------------------------------------------------------------
rem Use "exit n" with exit code n>0 to report on errors
rem ---------------------------------------------------------------
if not exist Demo.cfg (echo Demo.cfg is not found & exit 1)
