Full code below, sorry if the question looks jumbled.
I'm trying to make a batch file that adds a help doc to a specified directory, but the doc would need to have new lines. The problem is, is that I'm saving the text that gets put in the txt doc using a var.
I would like the help doc to look like this:
set help=helper \n new line \n\n more space
Which would look like this: (sorry, had to use code because a new line couldn't be made normally)
helper
new line
more space
I have seen things like the example down below, but when I do use this, the text in the doc just says echo is ON or echo is OFF, depending on whether or not echo is on (code found here):
setlocal EnableDelayedExpansion
set LF=^
rem TWO empty lines are required
echo This text!LF!uses two lines
And on top of that, this code looks like its new line var makes a spacer, rather than JUST a new line, like the, "helper," and, "new line," in the example I put above. I would want, "\n," to put the following text in the next line, and, "\n\n," to put the text two lines after the previous text, like, "more space," in the example above. In short, I'd like, "\n," to be a new line, and, "\n\n," to be a line break.
Thank you for taking the time to read this, I appreciate all answers and/or tips. If you're confused on anything that I mean, please feel free to ask me in the comments. I am pretty new to this, so my usage of some terminology is probably pretty poor. As well as that, sorry for the run on sentences and/or bad grammar/punctuation. I'm just a bit tired and I'm forgetting my English 1 classes, I suppose.
My full code is:
@echo off
:start
cls
echo -create
echo -download
echo.
set /p PROGRAM= What do you want to do?:
goto %PROGRAM%
:create
cls
REM saves the text types to the helpDir var
set /p helpDir=Where do you want to save the help file?:
REM makes the text used in the help.txt file, \n would be the new line,
set help=helper \n new line \n\n more space
REM I want to make it look like this:
REM helper
REM new line
REM
REM more space
REM Makes the "help" text to go to a .txt file, then saves the .txt file to the dir specified.
echo %help% > "%helpDir%\help.txt"
pause
goto start
REM not finished yet, please ignore
:download
title Custom Text File
cls
set /p help=Where do you want to save the help doc at?;
set /p txt=Made a command
echo %txt% > "dir
Pause