以下代码有什么问题?
@echo off
:fromFirst
set /p TN="Enter your name: ":
echo %TN%
set tim= %TIME%
echo %tim%
set det=%TN%%tim%
echo %det% >> List.txt
set /p ch="Do you want to continue(y/n):" :
IF "%ch%"=="y"
(
goto :fromFirst
)
ELSE(
exit
)
你能帮我解决这个问题吗?
答案 0 :(得分:1)
为什么你需要在 det 中设置set
变量,如果你之前已经在 TN 中为 name 时间 时间?
以下批次应该可以正常工作:
@echo off
:fromFirst
cls
set /p TN=Enter Your Name :
echo %TN%
set tim=%TIME%
echo %tim%
echo %TN% %tim% >>List.txt
set /p ch=Do You Wish to Continue? (y/n)
if "%ch%"=="y" goto fromFirst else exit