There is no problem. A trailing space for a redirect ( >> )
does not cause a problem. There is no need to remove
the trailing space.
Don't you realize that there might be something other than human eyes reading this file.
@BC_Programmer
Thank you. The escape ^ works. I adjusted the code a little. Removed the !in! !in2! !in3! and just made everything !in! because there is no point in using a new variable each time. I also fixed the file name issue.
Here is the final code. It works perfectly. No need for any more arguments.
@echo off
setlocal enabledelayedexpansion
set /p yorn=Would you like to setup the server name etc.(y/n)?
if /i %yorn%==y (
set /p in=Maximum clients:
echo maxclients !in!> bla.cfg
set /p in=Bot limit:
echo serverbotlimit !in!>> bla.cfg
echo publicserver ^0>>bla.cfg
set /p in=Server title:
echo serverdesc "!in!">> bla.cfg
) else (
echo said no.
)
PS: Does anyone know how to mark resolved on this forum?