@echo off
cls
echo Hello, there! Today is
date /t
echo and the current time is
time /t
echo I'm so glad to meet you. My name is Hal 10000.
set /p name=What's your name?
cls
echo Well hello, %name%
echo Hey, %name%, & set /p "age"="how old are you in years?"
echo Well that's just great! I'm actually 115 today.
echo I look pretty good, huh!?
echo Well, gotta go, by!
exit
看来你需要一个 暂停 命令。你的代码正在正确执行,但是在你看到结果之前,没有什么可以阻止代码退出。
@Echo off
Echo This message will not be displayed.
cls
Echo This message will be displayed.
pause
exit
添加一个 暂停 在...之前 退出 将显示你的结果,直到按下按钮。