WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

User Sample Code

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Default Gateway

 Keywords:  

strComputer = "."
objWMIService = GetObject( StrCat( "winmgmts:\\", strComputer, "\root\CIMV2" ) )
colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration",,48)
ForEach objItem In colItems
   strDefaultIPGateway = objItem.DefaultIpGateway
   type = ObjectTypeGet(strDefaultIPGateway)
   If type == "NULL" Then Break
   Message("DefaultIPGateway: " , objItem.DefaultIPGateway(0) )
Next
colItems = 0
objWMIService = 0

Article ID:   W17328
File Created: 2007:07:03:14:29:30
Last Updated: 2007:07:03:14:29:30