简体   繁体   English

如何“回显”批处理文件中的变量?

[英]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?"

Your set statement is wrong you should not use % there. 您的set语句错误,您不应该在那里使用%。 It should be 它应该是

set /p password=

All you need to do is remove the %% when typing in your set command. 您只需在set命令中键入时删除%%即可。 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM