I have a batch file where a default variable is set at the top..then the user is presented with an option to change the default. If they hit "enter" it leaves default, however if they enter text, then it replaces the default with the text. I can' get the variable to be set for some reason. I am pretty new to BAT writing so I am sure its a simple syntax thing. In the code below, I just need the line that says SET FTPHOST = %sel2% to work. Right now, it doesn't change the vaule of FTPHOST from the default even when text is entered. Thanks!
set /P sel1=Do you wish to change the defaults? [Y, (N)]:
if /I "%sel1%"=="n" goto :_header
if /I "%sel1%"=="y" goto :_sethost
set /P sel2=Enter the new IP Address [%FTPHOST%]:
if not "%sel2"=="" goto else
SET FTPHOST = %sel2%