在批处理文件中隐藏输入 [英] Hide Input in Batch File

查看:84
本文介绍了在批处理文件中隐藏输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何将来自"set/p"命令的输入隐藏在批处理文件中.

I was wondering how I would go about Hiding the input from a 'set /p' command in a batch file.

set/p Password =您的密码是什么?

set /p Password=What is your password?

我们都知道输入密码就可以看到它.我怎么会把它藏起来?

We all know that inputting your password, you would be able to see it. How would I go 'bout hiding it ?

我尝试从此处.使用conset.exe,并使用:

I tried conset.exe from here. And used:

conset/PH Password =您的密码是什么?

conset /PH Password=What is your password?

然后我得到"Conset:错误设置变量":(

And i get "Conset: Error setting variable" :(

我的另一个想法是更改控制台窗口的颜色.但是,如何更改同一行的颜色?这样您可以看到问题,却看不到答案?

Another idea I had, was to change the colour of the console window. But how could I change the colour on the same line? So that you could see the question, but not see the answer?

专业人士有什么想法吗?

Any ideas from the pros?

推荐答案

您可能会在这里查看答案:

You can probably look at the answers here: Can I mask an input text in a bat file

我认为EditV32.exe和EditV64.exe是您最好的选择(并且由于可以使用conset,就我所知,它不随Windows一起提供,所以我不认为您会反对使用editv?)

I think EditV32.exe and EditV64.exe are the best options you have (and since you were OK to use conset, which as far as I know does not come with Windows, I don't think you would oppose to using editv?)

http://www.westmesatech.com/editv.html

也: http://social.technet.microsoft.com/Forums/zh-CN/ITCG/thread/7d2d92a5-5d59-4954-bf3e-22eeb5cf0ee6/

这篇关于在批处理文件中隐藏输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆