0
点赞
收藏
分享

微信扫一扫

获取本机IP地址的脚本

素的盐 2022-08-04 阅读 79


用法:保存为一个.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

举报

相关推荐

0 条评论