Easiest way to add a text to the beginning of another text file in Command Line (Windows)
What is the easiest way to add a text to the beginning of another text file in Command Line (Windows)? DarkwingDuck echo "my line" > newFile.txt type myOriginalFile.txt >> newFile.txt type newFile.txt > myOriginalFile.txt Untested. Double >> means 'append' Another variation on the theme. (echo New Line 1) >file.txt.new type file.txt >>file.txt.new move /y file.txt.new file.txt Advantages over other posted answers: minimal number of steps no temp file left over parentheses prevents unwanted trailing space in first line the move command "instantaneously" replaces the old version with the new the