Add space at the front when using Set /P c=.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
PAB
Posts: 139
Joined: 12 Aug 2019 13:57

Add space at the front when using Set /P c=.

#1 Post by PAB » 04 Oct 2019 08:01

Good afternoon everyone,

Code: Select all

Set c=""
Set /P c=Press [Y] ^&^ [Enter] to REBOOT NOW or [ANY key] to CONTINUE.
    If /I "%c%" EQU "Y" Goto :REBOOT
How can I adapt the code above to put a space at the front of the Press [Y] ^&^ [Enter] to REBOOT NOW or [ANY key] to CONTINUE. so it shows as a space in front in the cmd prompt please?

I used the Set c="" because I understand that it ignores the previous keystroke, or am I wrong?

I have tried several ways, including using "" etc!

Thanks in advance.


Post Reply