我需要一个批处理程序 .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
进一步阅读
- Windows CMD 命令行的 AZ 索引 | SS64.com
- Windows CMD 命令(分类) - Windows CMD - SS64.com
- CMD.exe(命令 Shell)-Windows CMD - SS64.com- 启动一个新的 CMD shell 并(可选)运行命令/可执行程序。