Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a line break when requesting user input (/P) in batch?

Is it possible to create a line break after a set /P command? I would like the user to be able to type on a new (blank) line instead of next to the existing prompt. For example:

set /P test=type now

echo %test%

This code simply lets the user type next to the prompt.

like image 740
EpicCyndaquil Avatar asked May 14 '13 06:05

EpicCyndaquil


Video Answer


1 Answers

If you want input on the following line, just use:

echo type now
set /p test=
echo %test%

The echo will output the prompt including the newline, then you just use set /p with no prompt.

like image 136
paxdiablo Avatar answered Oct 20 '22 15:10

paxdiablo