【笔记】批处理获取管理员权限
前言
批处理获取管理员权限
脚本
方法一
1 | 1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit |
方法二
1 | 1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit |
方法三
1 | echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" |
方法四
1 | nircmd elevate cmd /c "%0" |
方法五
1 | runas /noprofile /user:Administrator "%0" |