vbs wmi获取电脑硬件信息实例_vbs教程-查字典教程网
vbs wmi获取电脑硬件信息实例
vbs wmi获取电脑硬件信息实例
发布时间:2016-12-28 来源:查字典编辑
摘要:Setwmi=GetObject("winmgmts:")Setboard=wmi.instancesof("win32_baseboard...

Setwmi=GetObject("winmgmts:")

Setboard=wmi.instancesof("win32_baseboard")

ForEachbInboard

msg="主板:"&b.Manufacturer&vbTab&b.product&vbTab&Chr(13)

Next

msg=msg&Chr(13)&"---"+Chr(13)

Setcpus=wmi.instancesof("win32_processor")

msg=msg&"CPU特征:"+Chr(13)

ForEachcpuIncpus

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)

Setmem=wmi.instancesof("win32_physicalmemory")

msg=msg&"内存容量:"+Chr(13)

ForEachmInmem

msg=msg&m.tag&space(10)&m.capacity&+Chr(13)

Next

Setmem=wmi.instancesof("win32_computersystem")

ForEachmInmem

msg=msg&"内存总容量:"&Round((m.totalphysicalmemory/1024^2),2)&"M"+Chr(13)

Next

msg=msg&Chr(13)&"---"+Chr(13)

Setdisplay=wmi.instancesof("Win32_videocontroller")

msg=msg&"显示系统:"+Chr(13)

ForEachvideoIndisplay

msg=msg&video.deviceid&vbTab&video.name&Chr(13)

Next

msg=msg&Chr(13)&"---"+Chr(13)

Setdisks=wmi.instancesof("win32_diskdrive")

msg=msg&"硬盘容量:"+Chr(13)

ForEachdIndisks

Ifint(d.size/(1024^3))=0Then

n=Round(d.size/(1024^2),2)&"M"

Else

n=Round(d.size/(1024^3),2)&"G"

EndIf

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

Next

msg=msg&Chr(13)&"---"+Chr(13)

MsgBoxmsg,0,"电脑基本特征"

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新vbs学习
    热门vbs学习
    脚本专栏子分类