我是靠谱客的博主 野性大雁,这篇文章主要介绍用vbs得到计算机的 IP 地址,现在分享给大家,希望可以做个参考。

描述
返回安装在计算机中的每个支持 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 地址的全部内容,更多相关用vbs得到计算机的内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(131)

评论列表共有 0 条评论

立即
投稿
返回
顶部