一个很菜的问题.....

h1234 2003-12-14 11:38:24
我怎么样才可以在我的机子上运行这样一个脚本:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("192.168.0.20")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.0.1")
strNameServer=Array("202.97.224.68")
strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
If objNetAdapter.SettingID = "{6D61D0B2-A2E7-4732-955B-4871326D117F}" Then
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
errNameServer= objNetAdapter.SetDNSServerSearchOrder(strNameServer)
End If
Next
我没用过请各位多指教!!
...全文
84 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
87721054 2003-12-14
  • 打赏
  • 举报
回复
UP
suonety 2003-12-14
  • 打赏
  • 举报
回复
mark
enj1224 2003-12-14
  • 打赏
  • 举报
回复
加在模块里面

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧