|
>"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 |
|