4
I am trying to have my batch file write a string of text to a text file. At first, the command I was using was writing an extra carriage return to the end of the string, but I found this command that prevented that:
echo|set /p=hello>hello.txt
However, now it's putting a trailing space at the end. I need only the string I specify to be written without any extra characters. Is this possible?
Doesn't
echo mystring>test.txt
do just that? – Sean C. – 2012-07-09T15:14:32.653That's how I was doing it before when it was adding a carriage return at the end. – oscilatingcretin – 2012-07-09T15:16:27.970
Odd; I just tested it myself. When I open it in vim, the output contains no line breaks or spaces after the string. – Sean C. – 2012-07-09T15:17:31.823
I just tested it in a command window and the carriage return is there when I open it in Notepad. – oscilatingcretin – 2012-07-09T15:18:27.843
I am 100% wrong on this. Sorry. – Sean C. – 2012-07-09T15:37:44.510