I'm new in creating batch files. I have a question regarding the 'search and replace a string' function.
I use the BatchSubstitute.bat (http://www.dostips.com/DtCodeBatchFiles.php#Batch.FindAndReplace) to replace a string in a text file and create a new text file with the changed content. I created a batch file using the code:
Code: Select all
BatchSubstitute.bat OldText NewText Text01.txt>Text02.txt
This code is working well. But I would like to print the new file (Text02.txt). For this I created a batch file with the following code:
Code: Select all
BatchSubstitute.bat OldText NewText Text01.txt>Text02.txt
Print Text02.txt /D:\\w20hy116\ZDesignerHY116
where \\w20hy116\ZDesignerHY116 is a shared printer.
After executing the first line (with BatchSubstitute) the batch file is closed without executing the printing instruction.
How could I print the new text file? Please help.
Thanks