用WMI对象列出系统所有进程:
----Instance.vbs----
获得物理内存的容量:
-----physicalMemory.vbs-----
取得系统所有服务及运行状态
----service.vbs----
CPU的序列号:
---CPUID.vbs---
硬盘型号:
---HDID.vbs---
网卡MAC物理地址:
---MACAddress.vbs---
测试你的显卡:
OnErrorResumeNext
Dimye
Dimyexj00
setyexj00=GetObject(" winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_VideoController")
foreachyeinyexj00
msgbox"型号:"&ye.VideoProcessor&vbCrLf&"厂商:"&ye.AdapterCompatibility&vbCrLf&"名称:"&ye.Name&vbCrLf&"状态:"&ye.Status&vbCrLf&"显存:"&(ye.AdapterRAM\1024000)&"MB"&vbCrLf&"驱动(dll):"&ye.InstalledDisplayDrivers&vbCrLf&"驱动(inf):"&ye.infFilename&vbCrLf&"版本:"&ye.DriverVersion
next
----Instance.vbs----
程序代码
DimWMI,objs
SetWMI=GetObject(" WinMgmts:")
Setobjs=WMI.InstancesOf("Win32_Process")
ForEachobjInobjs
Enum1=Enum1+obj.Description+Chr(13)+Chr(10)
Next
msgboxEnum1
SetWMI=GetObject(" WinMgmts:")
Setobjs=WMI.InstancesOf("Win32_Process")
ForEachobjInobjs
Enum1=Enum1+obj.Description+Chr(13)+Chr(10)
Next
msgboxEnum1
获得物理内存的容量:
-----physicalMemory.vbs-----
程序代码
strComputer="."
SetwbemServices=GetObject(" winmgmts:\\"&strComputer)
SetwbemObjectSet=wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
ForEachwbemObjectInwbemObjectSet
WScript.Echo"物理内存(MB):"&CInt(wbemObject.TotalPhysicalMemory/1024)
Next
SetwbemServices=GetObject(" winmgmts:\\"&strComputer)
SetwbemObjectSet=wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
ForEachwbemObjectInwbemObjectSet
WScript.Echo"物理内存(MB):"&CInt(wbemObject.TotalPhysicalMemory/1024)
Next
取得系统所有服务及运行状态
----service.vbs----
程序代码
SetServiceSet=GetObject("
winmgmts:").InstancesOf("Win32_Service")
Dims,infor
infor=""
foreachsinServiceSet
infor=infor+s.Description+"==>"+s.State+chr(13)+chr(10)
next
msgboxinfor
Dims,infor
infor=""
foreachsinServiceSet
infor=infor+s.Description+"==>"+s.State+chr(13)+chr(10)
next
msgboxinfor
CPU的序列号:
---CPUID.vbs---
程序代码
DimcpuInfo
cpuInfo=""
setmoc=GetObject(" Winmgmts:").InstancesOf("Win32_Processor")
foreachmoinmoc
cpuInfo=CStr(mo.ProcessorId)
msgbox"CPUSerialNumberis:"&cpuInfo
next
cpuInfo=""
setmoc=GetObject(" Winmgmts:").InstancesOf("Win32_Processor")
foreachmoinmoc
cpuInfo=CStr(mo.ProcessorId)
msgbox"CPUSerialNumberis:"&cpuInfo
next
硬盘型号:
---HDID.vbs---
程序代码
DimHDid,moc
setmoc=GetObject(" Winmgmts:").InstancesOf("Win32_DiskDrive")
foreachmoinmoc
HDid=mo.Model
msgbox"硬盘型号为:"&HDid
next
setmoc=GetObject(" Winmgmts:").InstancesOf("Win32_DiskDrive")
foreachmoinmoc
HDid=mo.Model
msgbox"硬盘型号为:"&HDid
next
网卡MAC物理地址:
---MACAddress.vbs---
程序代码
Dimmc
setmc=GetObject(" Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
foreachmoinmc
ifmo.IPEnabled=truethen
msgbox"网卡MAC地址是:"&mo.MacAddress
exitfor
endif
next
setmc=GetObject(" Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
foreachmoinmc
ifmo.IPEnabled=truethen
msgbox"网卡MAC地址是:"&mo.MacAddress
exitfor
endif
next
测试你的显卡:
程序代码
OnErrorResumeNext
Dimye
Dimyexj00
setyexj00=GetObject(" winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_VideoController")
foreachyeinyexj00
msgbox"型号:"&ye.VideoProcessor&vbCrLf&"厂商:"&ye.AdapterCompatibility&vbCrLf&"名称:"&ye.Name&vbCrLf&"状态:"&ye.Status&vbCrLf&"显存:"&(ye.AdapterRAM\1024000)&"MB"&vbCrLf&"驱动(dll):"&ye.InstalledDisplayDrivers&vbCrLf&"驱动(inf):"&ye.infFilename&vbCrLf&"版本:"&ye.DriverVersion
next