有没有办法在批处理中使用多行用户输入提示?
我一直在尝试制作一个用户输入提示,该提示显示自身作为多行。
我希望它看起来的示例:
Welcome to the program!
What would you like to do?
option [1]
option [2]
option [3]
这就是我尝试这样做的方式:
set /p selection="Welcome to the program! ^ What would you like to do? ^ option [1] ^ option [2] ^ option [3]"
但是当我运行它时,它会像这样
Welcome to the program! What would you like to do? option [1] option [2] option [3]
谷歌搜索,但是我找不到任何帮助的东西,所以如果有人可以告诉我一个做到这一点的方法!
I've been trying to make a user input prompt that displays itself as multiple lines.
Example of how I want it to look:
Welcome to the program!
What would you like to do?
option [1]
option [2]
option [3]
This is how I tried to do that:
set /p selection="Welcome to the program! ^ What would you like to do? ^ option [1] ^ option [2] ^ option [3]"
But when I run that, it comes out like this:
Welcome to the program! What would you like to do? option [1] option [2] option [3]
I googled it but I couldn't find anything that helped, so if someone could tell me a way to do this that would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许很简单。
Maybe it's simple.
有一种方法可以做到这一点,也就是创建LineFeed变量。
set/p
版本:choce.exe
版本 (推荐)There is a way to do it, and that is by creating a linefeed variable.
SET /P
version:CHOICE.EXE
version (recommended)