hi
i want to execute lpr command replacing a substring in the filename
for example
LPR -S 192.168.3.20 -P AUTO d:\sample.txt
I want to replace the word sample with test because i really want to print file d:\test.txt
Is there any way i can do this with one command ?
replace string in filename
Moderator: DosItHelp
Here is a batch file you can try using as a external command.
http://www.dostips.com/?t=Batch_FindAndReplace
Replace the string and dump the new filename on the screen:
If you are happy with the resulting batch file, pipe it into a newfile and run it:
DosItHelp?
http://www.dostips.com/?t=Batch_FindAndReplace
Replace the string and dump the new filename on the screen:
Code: Select all
BatchSubstitute.bat "d:\sample.txt" "d:\test.txt" File.bat
If you are happy with the resulting batch file, pipe it into a newfile and run it:
Code: Select all
BatchSubstitute.bat "d:\sample.txt" "d:\test.txt" File.bat>NewFile.bat
NewFile.bat
DosItHelp?