用vbs得到計算機的 IP 地址
更新時間:2007年05月14日 00:00:00 作者:
描述
返回安裝在計算機中的每個支持 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
返回安裝在計算機中的每個支持 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)文章
ass2srt.vbs(ass/ssa批量轉(zhuǎn)換srt的腳本)
這篇文章主要介紹了ass2srt.vbs一個ass/ssa批量轉(zhuǎn)換srt的腳本,需要的朋友可以參考下2014-09-09VBS實現(xiàn)將當(dāng)前時間轉(zhuǎn)換成UTC時間
這篇文章主要介紹了VBS實現(xiàn)將當(dāng)前時間轉(zhuǎn)換成UTC時間,十分的簡單實用,需要的朋友可以參考下2015-05-05