I have a .bat file that would ask your name and save it in a .txt file. If the file already exists, I want it to say "Your Name is ____"
@echo off
if exist BatchfileOutput.txt (
cls
FOR /F %%i IN (BatchfileOutput.txt) DO echo Your name is %%i
) else (
echo What is your name?
set /p %name%= )
echo %name% > BatchfileOutput.txt
pause
It prints ECHO is off, probably due to @echo off at the top. If I manually add text to the file, it displays the text. Could anyone help me get around this?