Search code examples
windowsbatch-fileuser-inputpromptmultiline

Is there a way to have a multi line user input prompt in batch?


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!


Solution

  • Maybe it's simple.

    @echo off
    echo welcome to program!
    echo what would you like to do?
    echo option[1]
    echo option[2]
    echo option[3]
    
    set /p selection=