:Execute the command as an administrator
:
@echo on
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
:Execution script information
route add 172.0.0.0 mask 255.0.0.0 192.168.2.234

双击即可,不过在Windows10上面还是会弹出确认以下信息点击确认即可。此脚本省去了右键点击选择以管理员运行的操作
Windows 以管理员执行bat命令

相关文章:

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