Wmi转换
以下是一段vbs更改网关的wmi代码.请会的兄弟帮忙转换为au3代码.DefaultIPGateway1=Array("192.168.1.1")
ComputerName="."
Dim objWMIService,colItems,objItem,objAddress
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objItem in colItems
objItem.SetGateways(DefaultIPGateway1)
Next
我试过这样转换却报错,不成功!
$getaway = "192.168.1.2"
$ComputerName = "."
Dim $objWMIService, $colItems, $objItem, $objAddress
$objWMIService = ObjGet("winmgmts:\\" & $ComputerName & "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For $objItem In $colItems
$objItem.SetGateways($getaway)
Next 期待高手的解答。。顶起。。 呵呵,我也顶一下.希望能有人能解答. 加点变量符号试着改。。
页:
[1]