当前位置: 移动技术网 > IT编程>脚本编程>VBScript > vbs wmi获取电脑硬件信息实例

vbs wmi获取电脑硬件信息实例

2017年12月12日  | 移动技术网IT编程  | 我要评论

耶伦讲话直播,2008金瓶高清完整版,青岛胶南信息港

set wmi=getobject("winmgmts:\\")

set board=wmi.instancesof("win32_baseboard")
for each b in board
msg="主板:"&b.manufacturer&vbtab&b.product&vbtab&chr(13)
next
msg=msg&chr(13)&"---"+chr(13)

set cpus=wmi.instancesof("win32_processor")
msg=msg&"cpu 特征:"+chr(13)
for each cpu in cpus
msg=msg+cpu.deviceid&vbtab&cpu.name&chr(13) _
&vbtab&cpu.socketdesignation&vbtab&cpu.currentclockspeed&"mhz"&vbtab&cpu.l2cachesize&"kb_l2"&chr(13)
next
msg=msg&chr(13)&"---"+chr(13)

set mem=wmi.instancesof("win32_physicalmemory")
msg=msg&"内存容量:"+chr(13)
for each    m in mem
msg=msg&m.tag&space(10)&m.capacity&+chr(13)
next

set mem=wmi.instancesof("win32_computersystem")
for each m in mem
msg=msg&"内存总容量:"&round((m.totalphysicalmemory/1024^2),2)&"m"+chr(13)
next
msg=msg&chr(13)&"---"+chr(13)

set display=wmi.instancesof("win32_videocontroller")
msg=msg&"显示系统:"+chr(13)
for each     video in display
msg=msg&video.deviceid&vbtab&video.name&chr(13)
next
msg=msg&chr(13)&"---"+chr(13)


set disks=wmi.instancesof("win32_diskdrive")
msg=msg&"硬盘容量:"+chr(13)
for each d in disks
if int(d.size/(1024^3))=0 then 
n=round(d.size/(1024^2),2)&"m"
else
n=round(d.size/(1024^3),2)&"g"
end if

msg=msg+d.deviceid&"      空间为: "&n&chr(13)
next
msg=msg&chr(13)&"---"+chr(13)


msgbox msg,0,"电脑基本特征"

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网