[ Windows BAT Script ] BAT 脚本获取windows权限

BAT 脚本获取windows权限

 1 @echo off
 2 echo I am trying to run as Administrator
 3 %1 %2
 4 ver|find "5.">nul&&goto :st
 5 mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :st","","runas",1)(window.close)&goto :eof
 6 
 7 :st
 8 copy "%~0" "%windir%\system32\"
 9 echo Get the Administrator right well.
10 echo . 
11 echo "<your own code>"
12 echo .
13 @pause
14 @echo on

 

posted @ 2017-09-12 10:14  coder211  阅读(303)  评论(0编辑  收藏  举报