How can I create a .txt file in CMD?

Does anyone know how to create a .txt file on CMD ? .I need the order or steps to create it; I see that I need to write {echo "text"> "name" .txt}, but I mean the content is out of order and sometimes it doesn't respond correctly.

Thanks guys, Well, I know I wasnโ€™t so frank about what I wanted to do and Iโ€™m sorry, but your advice helps me a lot too, so thank you u.

+3


source to share


1 answer


Try to create a variable with text first like this:

set /p txt=Your Text Content; 
echo %txt% > "Location\textfile.txt"

      

EDIT: If you mean the newline is not showing, then you need to do the following:



echo "FirstLine" > "Location\textfile.txt"
echo. "SecondLine" > "Location\textfile.txt"

      

echo. instead of echo, a new line will start.

+1


source







All Articles