1

我正在使用 Albacore,我想运行一个需要提升为管理员的批处理文件。权利检查如下:

批处理文件:

AT > NUL
IF %ERRORLEVEL% NEQ 0 GOTO AdminRightError

:: more code here

:AdminRightError
ECHO You are not running as administrator!

耙文件:

exec :CmdRunBatch do |cmd|
  cmd.command = "RunCommands.bat"
end

当我rake CmdRunBatch通过正常(非提升)命令行执行时,我得到批处理文件中描述的 AdminRightError。有没有办法解决这个问题?

4

0 回答 0