如何回答" Set / p选项"在新线上命令?

时间:2015-06-25 13:40:59

标签: batch-file

代码:

@set /p choice= How are you?(answer is here)

@echo %choice%?

@pause

期望的输出:

@set /p choice= How are you?
(answer here)
@echo %choice%?

@pause

2 个答案:

答案 0 :(得分:2)

是的,这很容易:

@echo off
echo How are you?
set /p "choice="
echo %choice%?
pause

答案 1 :(得分:2)

编辑26/06/2015 ==>感谢Aacini的评论!

要批量回复换行符(不得失败),您应该添加echo(

@echo off
echo How are you ?
::Skip two lines if you want
echo( & echo(
set /p "choice= "
echo(
echo %choice%
echo(
pause