Add spaces in set /P c=

September 25, 2011 at 19:12:49
Specs: Windows 7
set /P c=Delete Message? [Y/N]?
I want to add a spaces after the c=

So the text on screen will be
(insert tab here) Delete Message? [Y/N]?

(Basically getting it a few spaces from the side of the command window edges.)

I can do it with echo by just adding spaces between the echo and the text.

Can the same be done with this ?

See More: Add spaces in set /P c=

Report •

September 25, 2011 at 19:44:46
This sounds like something you could have tested for yourself in less time than it took you to ask the question.

EDIT: As someone well outside of my pay grade once said, You don't need to ask me a question the compiler can answer more accurately.

How To Ask Questions The Smart Way

Report •

September 25, 2011 at 22:32:41
I did test , and could not find a solution.
You have helped me in the past a whole lot, and I assumed you would know the answer or if it was not possible?

Report •

September 26, 2011 at 07:35:50
set /P c= Delete Message? [Y/N]?

A space, there you go.

Happy is ONE who says I am an OttoMAN.

Report •

Related Solutions

September 26, 2011 at 08:18:17
Except that doesn't display a leading space.

I tried the <alt>-255 trick, but that doesn't work either. All I can think is that you put something unobtrusive, like a full stop, at the start of the string.

Report •

September 26, 2011 at 11:49:48
yes you can and i preffer set/p c= " delete ? [y/n] "
why ""
if you got "" it means that you can do this
set/p c=" delete message? "
and it will still work, :)

Report •

September 26, 2011 at 11:55:07
You could also do

echo (however many spaces) delete [y/n]
set /p c=
if "%c%"=="y" then
if "%c%"=="n" then

same stuff different approach

Report •

September 26, 2011 at 12:42:04
I thought of that approach but, unfortunately, the y (or n) then appears flush left on the next line, which isn't very pretty. Any attempt to introduce spaces, whether within quotes or not, in the "set /p" line doesn't work - leading spaces are stripped when the message is printed. (At least they are on my Windows 7 system.)

Report •

September 27, 2011 at 09:23:09
set/p c=" what ever you like, you can use spaces "
when you put "" anything inside it (you can use spaces too) will work!!!
try it out :)

Report •

September 27, 2011 at 11:05:20
I tried it. It doesn't work. Leading spaces are dropped when it prints the prompt. (Windows 7)

Report •

Ask Question