Using echo without trailing space in DOS
问题 I noticed that when I use echo to print something to a file in DOS, a space is appended to the string. I need to print the string without the trailing space. Is there a way to do that, or as a workaround, remove trailing spaces from the file? 回答1: If I understood the problem correctly, you wrote the trailing space. Instead of echo string > file use echo string>file 回答2: Assuming you're talking about cmd.exe rather than the actual (rather outdated) MSDOS, there are a number of ways to do this,