这将是Windows批处理相当于HTML的输入类型= QUOT;密码"? [英] What would be the Windows batch equivalent for HTML's input type="password"?
本文介绍了这将是Windows批处理相当于HTML的输入类型= QUOT;密码"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个Windows脚本,但经典的第一谷歌的结果的方法内的用户身份验证凭据:
I need to get authentication credentials from the users within a Windows script but the classic "first Google result" approach:
SET /P USR=Username:
SET /P PWD=Password:
不到满意的,所以如果有我们说的等价物为 HTML的输入类型=密码
任何意见将是真正的AP preciated,感谢很多提前!
Any comment would be really appreciated, thanks much in advance!
推荐答案
看看这个
<一个href=\"http://www.netikka.net/tsneti/info/tscmd052.htm\">http://www.netikka.net/tsneti/info/tscmd052.htm
@echo off & setlocal enableextensions
:: Build a Visual Basic Script
set vbs_=%temp%\tmp$$$.vbs
set skip=
findstr "'%skip%VBS" "%~f0" > "%vbs_%"
::
:: Prompting without linefeed as in Item #15
echo.|set /p="Password: "
:: Run the script with Microsoft Windows Script Host Version 5.6
for /f "tokens=* delims=" %%a in ('cscript //nologo "%vbs_%"') do set MyPass1=%%a
::
::echo.
echo.|set /p="Retype : "
for /f "tokens=* delims=" %%a in ('cscript //nologo "%vbs_%"') do set MyPass2=%%a
::
:: Clean up
for %%f in ("%vbs_%") do if exist %%f del %%f
::
:: Demonstrate the result
echo.
if "%MyPass1%"=="%MyPass2%" (
echo The entered password was %MyPass1%
) else (
echo No match)
endlocal & goto :EOF
'
'The Visual Basic Script
Set WshPass = WScript.CreateObject("ScriptPW.Password") 'VBS
Password=WshPass.GetPassWord() 'VBS
WScript.Echo PassWord 'VBS
这篇关于这将是Windows批处理相当于HTML的输入类型= QUOT;密码&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文