[英]Batch: echo some text and read the rest of the line
I've got 我有
echo sometext
set /p s=
but it will output the following: 但它将输出以下内容:
sometext
*will read this line*
and I want it to be in the same line like this: 我希望它在同一行中,如下所示:
sometext *will read the rest of the line*
but HOW? 但是如何?
This: 这个:
SET /P s="sometext "
Will print sometext
and place the prompt right after the text. 将打印
sometext
文本并将提示放在文本之后。
You should initialize the input variable and put the double quotes on the right place: 您应该初始化输入变量并将双引号放在正确的位置:
SET "s="
SET /P "s=sometext> "
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.