2009-05-27 20 views
1

就像你已經知道的那樣,網站有一些特殊的密碼字符,比如星星和圈子。批處理文件:密碼星星/圈子

這可能在一個批處理文件,在下面的一個:?

如果這是不可能的,如果你輸入它,你能看到什麼?

set pass= 
set /p pass=Enter your password: 
if {%pass%}=={} goto :begin 
set authenticated= 
for /f "tokens=*" %%a in (pass.txt) do (
    if {%%a}=={%pass%} set authenticated=true 
) 
if not defined authenticated (echo Invalid password & goto :begin) 

但我需要在這上面得到這樣的:

for /f "delims=" %%i in ('cscript /nologo GetPwd.vbs') 

怎麼樣!

+0

可能重複[什麼是Windows的批處理等效HTML的輸入類型=「密碼「?](http://stackoverflow.com/questions/286871/what-would-be-the-windows-batch-equivalent-for-htmls-input-typepassword) – Helen 2010-09-09 18:03:46

+1

可能重複的[我可以掩碼輸入文本在一個bat文件](htt P://stackoverflow.com/questions/664957/can-i-mask-an-input-text-in-a-bat-file) – SomethingDark 2016-04-29 02:16:30

回答

1

另一種選擇是我的EditV32(x86)或EditV64(x64)命令行工具。例如:

editv32 -m -p 「密碼:」 PWD

-m是指 「掩蔽的輸入」 和-p是提示。用戶的輸入存儲在PWD環境變量中。你可以在這裏得到它:

www.westmesatech.com/editv.html

的問候,比爾

3

不是直接。你必須在別的東西上寫一個密碼輸入程序,然後從批處理文件中運行它來捕獲密碼。

+0

我希望你仍然可以。 – 2009-05-27 16:43:15

+0

有人請告訴我它的可能 – 2009-05-27 16:47:23

+0

和...如果你輸入它,但只是沒有看到? – 2009-05-27 16:48:35

1

得到它完成:

批處理文件:

@echo off 
<nul: set /p passwd=Password: 
for /f "delims=" %%i in ('cscript /nologo GetPwd.vbs') do set passwd=%%i 

GetPwd.vbs:

Set oScriptPW = CreateObject("ScriptPW.Password") 
strPassword = oScriptPW.GetPassword() 
Wscript.StdOut.WriteLine strPassword