Asked By
0 points
N/A
Posted on - 08/28/2012
Batch file to add line to top and bottom
Hi there,
I can provide you with commands that will definitely going to add lines at top and bottom of your Batch data File,
Back up your old file and use these commands,
Â
@echo off
echo ***New top line*** > temp.txt
for /f "tokens=*" %%a in (yourfile.txt) do (
 echo %%a >> temp.txt)
echo ***New bottom line*** >> temp.txt
echo y|del yourfile.txt
rename tempt.txt yourfile.txt
Â
That should work out your problem,
If above given command does not works then use following command which is relatively shorter
Â
@echo off
echo ***New top line*** > temp.txt
type myfile >> temp.txt
echo ***New bottom line*** >> temp.txt
move /y temp.txt myfile
Â
Hope that works!!