通过批处理调用管理员身份运行程序
通过批处理调用管理员身份运行程序
@REM 申请管理员权限访问
%1 %2
ver|find "5.">nul&&goto :Admin
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
:Admin
@REM 需要执行的命令
@REM 这里运行你需要运行的程序脚本
@REM 例如
echo 使用管理员身份运行脚本,执行重启操作 &pause>nul
shutdown -r
shutdown -a

浙公网安备 33010602011771号