【问题标题】:where should i set password in this我应该在哪里设置密码
【发布时间】:2017-06-20 14:32:10
【问题描述】:
@echo off
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
    $BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
        [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set password=%%p
echo %password%

【问题讨论】:

  • 这还不清楚,至少可以这么说。
  • 我什至无法猜出提问者想要做什么......

标签: batch-file passwords hide mask


【解决方案1】:

使用这个:

::By SachaDee - 2015
@echo off&cls

::the password
set $MDP=toto1234

for /f "delims=" %%a in ('powershell -c "$rep=read-host Enter your PWD -AsSecureString;$password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($rep));write $password"') do set $rep=%%a
if %$MDP%==%$rep% (echo PWD ok) else (echo PWD not ok)
exit/b

【讨论】:

  • 嗨,我应该把我的通行证放在哪里
猜你喜欢
  • 2013-07-05
  • 2015-09-06
  • 2015-06-28
  • 1970-01-01
  • 2016-05-12
  • 1970-01-01
  • 1970-01-01
  • 2016-01-21
  • 2014-08-24
相关资源
最近更新 更多