通过脚本自动请求给予管理员,弹出是否管理员权限打开bat脚本
调用vbs
@echo off
setlocal EnableDelayedExpansion
color 3e
pushd %~DP0 & cd /d "%~dp0"
%1 %2
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :runas","","runas",1)(window.close)&goto :eof
:runas
::你的脚本
::echo 执行完毕,任意键退出
::pause >nul
exit
标签:脚本,goto,runas,echo,管理员,权限
From: https://www.cnblogs.com/manzuixin/p/16823388.html