如何在 set /p 命令后使用 echo 命令
我想让这个脚本以某种方式工作,但我发现在你使用后
set /p variable= whater you want here
如果你在它后面使用 echo 命令,它会被隐藏或其他什么,因为它不会出现...
@echo off
cls
color A
:MAIN
cls
echo.
echo.
echo =================================
echo. set /p var= what is your name?
:: DOES NOT SHOW UP (STARTING HERE)
echo.
echo =================================
:: DOES NOT SHOW UP (ENDING HERE)
set /p answer= so your name is %var%?
IF %answer%== yes echo thats an amazing name!
IF %answer%== no goto MAIN
被注释包围的部分不想出现出于某种原因...有什么想法吗?
I wanted to make this script work somehow, but i find that after you use
set /p variable= whater you want here
If you use the echo command after it, its hidden or something because it wont come up...
@echo off
cls
color A
:MAIN
cls
echo.
echo.
echo =================================
echo. set /p var= what is your name?
:: DOES NOT SHOW UP (STARTING HERE)
echo.
echo =================================
:: DOES NOT SHOW UP (ENDING HERE)
set /p answer= so your name is %var%?
IF %answer%== yes echo thats an amazing name!
IF %answer%== no goto MAIN
The part thats surrounded by the remarks doesnt want to show up for some reason... any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果我理解你想要做什么,这就是你需要的代码:
If I'm understanding what you are trying to do, this is the code you need:
因为处理器在打印
what is your name?
后会等待用户输入(由于/p
),所以你不会得到下一行= =======
等等。直到按下回车键。Because the processor will wait for the user input after printing
what is your name?
(due to the/p
), you will not get the next line of========
etc. until enter is pressed.它出现在我面前,我明白
这就是我所期望的,你期望什么?
It shows up for me, I get
Which is what I would expect, what are you expecting?