Windows 7 batch files: How to write string to text file without carriage return AND trailing space?
Posted
by
oscilatingcretin
on Super User
See other posts from Super User
or by oscilatingcretin
Published on 2012-07-09T15:10:42Z
Indexed on
2012/07/09
15:18 UTC
Read the original article
Hit count: 218
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?
© Super User or respective owner