I'm trying to write a batch file which ECHOs certain output to a text file.
At the very end of the text file a set of double quotes (") need to appear.
The batch file is creating a .REG file to be imported into Windows. The first part of a file is simply part of a registry file, followed by the contents of an environment variable, %USERNAME%.
After %USERNAME%, there needs to be a set of double quotes (") at the end so that Windows recognizes this as a registry entry.
However, when I try to append this to the end of the batch file, it ends up with the " on the next line, for example:
(what I want):
(what I don't want, which is happening now):
Can someone help me figure out how to make it so that the " is appended to the end of the line, with no carriage return after the USERNAME?
I've tried the following, which actually works when I type it from the command prompt, but fails from within a batch file:
echo %ALPHA% >> myfile.reg