用vbs得到計(jì)算機(jī)的 IP 地址
更新時(shí)間:2007年05月14日 00:00:00 作者:
描述
返回安裝在計(jì)算機(jī)中的每個(gè)支持 IP 的網(wǎng)絡(luò)適配器的 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
返回安裝在計(jì)算機(jī)中的每個(gè)支持 IP 的網(wǎng)絡(luò)適配器的 IP 地址。
腳本代碼
復(fù)制代碼 代碼如下:
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
相關(guān)文章
vbs實(shí)現(xiàn)的保存剪貼板中的文本并編輯或保存
這篇文章主要介紹了通過(guò)vbs實(shí)現(xiàn)的保存剪貼板中的文本實(shí)現(xiàn)編輯或保存的實(shí)現(xiàn)方法,需要的朋友可以參考下2014-05-05
[導(dǎo)入][原創(chuàng)]用腳本控制迅雷下載
[導(dǎo)入][原創(chuàng)]用腳本控制迅雷下載...2007-03-03
VBS教程:函數(shù)-派生數(shù)學(xué)函數(shù)
VBS教程:函數(shù)-派生數(shù)學(xué)函數(shù)...2006-11-11

