查看本机网络属性的VBS
来源:互联网 发布:centos yum pip 编辑:程序博客网 时间:2024/05/21 21:43
'关键代码来自网络
' ----- ExeScript Options Begin -----
' ScriptType: window
' DestDirectory: temp
' Icon: default
' OutputFile:
' ----- ExeScript Options End -----
option explicit
dim strComputer
dim strResult
dim objWMIService
dim IPConfigSet
dim IPConfig
dim strAddress
dim colComputers
dim objComputer
dim strMac
strComputer = "."
strResult = "IP: "
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 Each strAddress in IPConfig.IPAddress
strResult = strResult & strAddress & " "
Next
End If
Next
strResult = strResult & vbCrLf & "主机名为 "
strComputer = "."
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colComputers = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
strResult = strResult & objComputer.Name & vbCrLf
Next
set colComputers = objWMIService.ExecQuery("Select MACAddress from Win32_NetworkAdapterConfiguration")
strResult = strResult & vbCrlf & "MAC地址 " & vbCrlf
for each IPConfig in colComputers
if not IsNull(IPConfig.MACAddress) then
strResult = strResult & IPConfig.MACAddress & vbCrlf
end if
next
Wscript.Echo strResult
- 查看本机网络属性的VBS
- 查看本机当前网络连接数
- vbs读注册表获取本机的CPU信息
- VBS教程:获取本机网卡地址
- 查看本机上的字符集
- 如何查看本机的端口号
- 查看本机的所有端口
- 批处理查看本机的IP
- 查看本机的IP 地址
- 查看本机端口的使用情况
- 查看本机端口的使用情况
- 如何查看本机的flash版本
- Linux 查看本机的开放端口
- 查看本机的用户 net user
- linux查看本机的连接
- 如何查看本机的IP地址
- 查看本机的系统字符集
- 7.查看本机的ip地址,查看本机的程序的端口号
- 让datagridview或girdview指定的一行或多行变色
- This application is currently offline...异常
- 编写TCP异步通信组件之AsyncTCPServer
- 发表文章报.text错误的bug已修正
- 编写TCP异步通信组件之AsyncTCPClient
- 查看本机网络属性的VBS
- SQL-left join的总结
- apache 定制日志
- 编写TCP异步通信组件之SocketObject
- appfuse下使用ibatis的一般步骤和若干问题
- .net 2.0 下发送邮件的方式。System.Web.Mail 过时用System.Net.Mail
- MD5 在线加密
- 兔子的悲哀
- JSP表达式语言----EL语言