Easiest way to add a text to the beginning of another text file in Command Line (Windows)

dr. evil picture dr. evil · Feb 15, 2009 · Viewed 94.9k times · Source

What is the easiest way to add a text to the beginning of another text file in Command Line (Windows)?

Answer

DarkwingDuck picture DarkwingDuck · Feb 15, 2009
echo "my line" > newFile.txt
type myOriginalFile.txt >> newFile.txt
type newFile.txt > myOriginalFile.txt

Untested. Double >> means 'append'