找回密码
 加入
搜索
查看: 1269|回复: 0

au3 改IP地址出现错误提示,错误如下,请教

[复制链接]
发表于 2009-10-24 23:41:51 | 显示全部楼层 |阅读模式
>"D:\autoit3\SciTE\ACNWrapper\ACNWrapper.exe" /run /ErrorStdOut /in "C:\Users\Administrator\Desktop\abc\first.au3" /autoit3dir "D:\autoit3" /UserParams   
+>23:36:01 开始执行 ACNWrapper v.1.0.0.4
+>执行环境:
+>        系统语言:        0804
+>        键盘布局:        00000804
+>        操作系统:        WIN_7/
+>        系统构架:        X86
+>        CPU构架:        X64
+>        AU3版本:        3.3.1.1
+>        IP地址:                192.168.1.101
>运行 AU3Check (1.54.16.0)  开始目录:D:\autoit3
+>23:36:01 AU3Check 结束[CODE]:0
>运行:(3.3.1.1):D:\autoit3\autoit3.exe "C:\Users\Administrator\Desktop\abc\first.au3"   
C:\Users\Administrator\Desktop\abc\first.au3 (225) : ==> ???????????("Object").:
$colComputers = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
$colComputers = $objWMIService^ ERROR
->23:36:05 AutoIT3.exe 完成:[CODE]:1
+>23:36:06 ACNWrapper 完成!
>退出代码: 1    时间: 5.691





运行以下代码是出错

Func _SetComputerName($_computername)
$strComputer = "localhost"
         $objWMIService = ObjGet("winmgmts:\" & $strComputer & "\root\cimv2")
         $colComputers = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
         For $objComputer In $colComputers
                 $objComputer.Rename ($_computername)
             Next
         EndFunc        
         
Func _SetIpAddress($_ip, $_netmask, $_gateway)
     $objWMIService = ObjGet("winmgmts:\" & "." & "\root\CIMV2")
     $colItems = $objWMIService.ExecQuery("Select * FROM Win32_NetworkAdapterConfiguration Where IPEnabled =TRUE")
     $_IP = _ArrayCreate($_IP)
     $_netmask = _ArrayCreate($_netmask)
     $_gateway = _ArrayCreate($_gateway)
     $GatewayMetric = _ArrayCreate("1")
     
     For $objItem In $colItems
         $errEnable = $objItem.EnableStatic($_ip, $_netmask)
         $errGateways = $objItem.SetGateways($_gateway, $GatewayMetric)
     Next
EndFunc   

Func _DNS($_dns1, $_dns2)
     $objWMIService = ObjGet("winmgmts:\" & "." & "\root\CIMV2")
     $colItems = $objWMIService.ExecQuery("Select * FROM Win32_NetworkAdapterConfiguration Where IPEnabled =TRUE")
     $DNS = _ArrayCreate($_dns1, $_dns2)
     
     For $objItem In $colItems
         $strDNSServerSearchOrder = $objItem.SetDNSServerSearchOrder($dns)
     Next
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-26 13:43 , Processed in 0.095177 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表