页面导航: 首页脚本专栏vbs → 正文内容

用vbs得到计算机的 IP 地址

发布:dxy 字体:[增加 减小] 类型:转载
描述
返回安装在计算机中的每个支持 IP 的网络适配器的 IP 地址。
脚本代码

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 
Set IPConfigSet = objWMIService.ExecQuery _ 
    ("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") 
For Each IPConfig in IPConfigSet 
    If Not IsNull(IPConfig.IPAddress) Then  
        For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) 
            WScript.Echo IPConfig.IPAddress(i) 
    Next 
    End If 
Next 

百度中搜索更多的关于用vbs得到计算机的 IP 地址内容,或者用Google搜索相关更多
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行