mrgerbik2013
mrgerbik2013

Reputation: 97

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?

Upvotes: 0

Views: 89

Answers (2)

Endoro
Endoro

Reputation: 37569

You should initialize the input variable and put the double quotes on the right place:

SET "s="
SET /P "s=sometext> "

Upvotes: 1

Ebbe M. Pedersen
Ebbe M. Pedersen

Reputation: 7488

This:

SET /P s="sometext "

Will print sometext and place the prompt right after the text.

Upvotes: 4

Related Questions