#include <array.au3>
$aRouteList = _RouteList()
_ArrayDisplay($aRouteList)
MsgBox(64, "Сообщение", "Default Gateway Address: "& $aRouteList[1][4])
Func _RouteList($sComp = ".")
Local $aRoutCode[5] = [0, "Other", "Invalid", "Direct", "Indirect"]
Local $sQuery, $cPersist
Local $aRoute[1][9] = [[0,"Persistent","Destination","Mask","Gateway", _
"Metric","Interface","Protocol","Route"]]
Local $aProtCode[15]= [0,"Other","Local","Netmgmt","icmp","egp","ggp", _
"hello","rip","is-is","es-is","CiscoIgrp","bbnSpfIgp","ospf","bgp"]
Local $oWMI = ObjGet("winmgmts:{impersonationLevel=Impersonate}!\\"& _
$sComp &"\root\cimv2")
If Not(IsObj($oWMI)) Then Return SetError(1, 1, $aRoute)
Local $cRoute = $oWMI.InstancesOf("Win32_IP4RouteTable")
If Not(IsObj($cRoute)) Then Return SetError(1, 2, $aRoute)
ReDim $aRoute[$cRoute.Count+1][9]
For $oRoute In $cRoute
$sQuery = "Associators of {"& $oRoute.Path_.RelPath & _
"} Where AssocClass=Win32_ActiveRoute"
$cPersist = $oWMI.ExecQuery($sQuery)
If Not(IsObj($cPersist)) Then Return SetError(1, 3, $aRoute)
$aRoute[0][0]+=1
$aRoute[$aRoute[0][0]][0] = $aRoute[0][0]
$aRoute[$aRoute[0][0]][1] = ($cPersist==1)
$aRoute[$aRoute[0][0]][2] = $oRoute.Destination
$aRoute[$aRoute[0][0]][3] = $oRoute.Mask
$aRoute[$aRoute[0][0]][4] = $oRoute.NextHop
$aRoute[$aRoute[0][0]][5] = $oRoute.Metric1
$aRoute[$aRoute[0][0]][6] = $oRoute.InterfaceIndex
$aRoute[$aRoute[0][0]][7] = $aProtCode[$oRoute.Protocol]
$aRoute[$aRoute[0][0]][8] = $aRoutCode[$oRoute.Type]
Next
Return $aRoute
EndFunc ; ==> _RouteList (AutoIT v3.3.0.0)