I have a template file that has the following abbreviated text in it.
Code: Select all
@echo off
REM - -------------------------------------------------------------------------
REM - File Name: --FileName
... (abreviated)
@echo on
I created a command file to copy this template file and give it a new name. Here is the contents of that command file.
Code: Select all
@echo off
set file_name=c:\scripts\cmds\cmd-%1.cmd
cp c:\scripts\cmds\_cmd.template %file_name%
REM sed 's/--FileName/%file_name%/g'<%file_name% >%file_name%
@echo on
I tried using sed but I would prefer to learn the dos way of replacing just the text '--FileName' copied from the template in the new file. I found an executable fart.exe but I think it does batches of files and not just a single file. Any help is greatly appreciated. Thanks for your time and consideration.
- Mike