把这段写在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_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"c:\\windows\\system32\\cmd.exe"="RUNASADMIN" 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2021-04-19
  • 2021-11-15
  • 2021-11-04
  • 2021-10-15
猜你喜欢
  • 2021-12-15
  • 2021-10-13
  • 2021-10-03
  • 2021-10-01
  • 2022-02-17
  • 2021-06-15
相关资源
相似解决方案