将密码变量传递给 manage-dbe

将密码变量传递给 manage-dbe

我需要一个批处理程序 .bat 来将提示的密码传递给manage-bde -unlock -pw.

尝试了这个带密码 devel 的 unlock.bat!

@ECHO OFF
:GetID
set "id="
set /P id=Enter id:
cmd /k manage-bde -unlock  K: -pw %id%
ERROR: Invalid Syntax.
"devel!" was not understood.
Type "manage-bde -?" for usage.

答案1

错误:语法无效。

您需要用引号括住命令:

cmd /k "manage-bde -unlock  K: -pw %id%"

句法

CMD [charset] [options] [/K Command] 

Command : The command, program or batch script to be run.
          This can even be several commands separated with '&' 
          (the whole should also be surrounded by "quotes")

来源:CMD.exe(命令 Shell)-Windows CMD - SS64.com


进一步阅读

相关内容