0%
前言
批处理获取管理员权限
脚本
方法一
1
| %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
|
方法二
1 2
| %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit exit /B
|
方法三
1 2 3 4 5
| echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs" >nul exit /B
|
方法四
1 2
| nircmd elevate cmd /c "%0" exit /B
|
方法五
1 2
| runas /noprofile /user:Administrator "%0" exit /B
|
完成
参考文献
博客园——conducer