我正在使用Albacore,我想运行需要以管理员身份提升的批处理文件。
权利被检查为:
批处理文件:
AT > NUL
IF %ERRORLEVEL% NEQ 0 GOTO AdminRightError
:: more code here
:AdminRightError
ECHO You are not running as administrator!
Rake文件:
exec :CmdRunBatch do |cmd|
cmd.command = "RunCommands.bat"
end
当我通过普通(非提升)命令行执行rake CmdRunBatch
时,我得到批处理文件中描述的AdminRightError。有没有办法解决这个问题?