把这段写在bat文件的前头即可
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit cd /d "%~dp0"
下面附段reg文件,把cmd这样的东西自动以管理员运行
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers]
"c:\windows\system32\cmd.exe"="RUNASADMIN"