您的位置:首页 > 其它

获取本机IP地址的脚本

2004-12-23 20:21 399 查看
用法:保存为一个.vbs文件,双击运行。

set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}").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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  each 脚本