harrison4354
harrison4354

Reputation: 91

How do I "echo" a variable in a batch file?

I typed in this:

:Password1
Echo so, make up a password for your info.
Set /p %password%=
echo OKAY! your password is %password% , right?
echo (Y/N)

and it comes out as this:

So, make up a password for your info.
(me:) Password
OKAY! your password is , right?

I want it to say

"OKAY! your passsword is "Password", right?"

Upvotes: 9

Views: 93917

Answers (2)

cool username
cool username

Reputation: 51

All you need to do is remove the %% when typing in your set command. This is what it should be:

:Password1
Echo so, make up a password for your info.
Set /p password=
echo OKAY! your password is %password% , right?
echo (Y/N)

Upvotes: 4

Chamindu
Chamindu

Reputation: 716

Your set statement is wrong you should not use % there. It should be

set /p password=

Upvotes: 6

Related Questions