找回密码
 加入
搜索
查看: 2125|回复: 4

VBS转AU3怎么转??

  [复制链接]
发表于 2010-2-4 00:13:18 | 显示全部楼层 |阅读模式
if Num<10 then
Name="00"
else
if Num<100 then
Name="0"
else
Name=""


Set sh = Nothing
Set oShell = Nothing
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("192.168.0."&Num)
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.0.1")
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway)

Dim dns
dns=Array("61.128.128.68","61.128.192.68")
err=objNetAdapter.SetDNSServerSearchOrder(dns)
发表于 2010-2-4 01:38:42 | 显示全部楼层
汉化版本身已经集成,参考ACN_NET.au3
发表于 2010-2-4 06:25:56 | 显示全部楼层
我来回复
$colItems = ""
$strComputer = "localhost"
$objWMIService = ObjGet("winmgmts:\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled=TRUE", "WQL", 0x10 + 0x20)
Local $strIPAddress[1] = ["192.168.1.235"]
Local $strSubnetMask[1] = ["255.255.254.0"]
Local $strGateway[1] = ["192.168.1.1"]
Local $dns[2] = ["202.96.128.80", "202.96.128.81"]
For $objItem In $colItems
        $objItem.EnableStatic($strIPAddress, $strSubnetMask)
        $objItem.SetGateways($strGateway)
        $objItem.SetDNSServerSearchOrder($dns)
Next
MsgBox(0,"","完成")
 楼主| 发表于 2010-2-4 15:34:56 | 显示全部楼层
谢谢,你们的回答,。
发表于 2010-2-4 20:44:32 | 显示全部楼层
呵呵,学习一下。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 14:28 , Processed in 0.075614 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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