【发布时间】:2018-12-28 21:49:20
【问题描述】:
我有一个从用户那里获取输入的 .bat 文件。我希望此输入在用户键入时不可见,以确保安全。输入是用户的密码,因此重要的是它不能被回头看的人看到。
现在的脚本有:
@echo off
set /p password="Enter the password for the connection: "
【问题讨论】:
-
您可能想使用已有十年历史的技术,而不是已有 4 年历史的技术,并使用 PowerShell 开箱即用地处理这个问题。
-
批处理文件可以使用
Runas,就像powershell一样,即使Powershell有Get-Credential
标签: windows batch-file