On Error Resume Next
Temp = 0
Set WSHNetwork = WScript.CreateObject("WScript.Network")
ComputerName = WSHNetwork.ComputerName
TempFiles = desktop & ComputerName &".txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TempFile = FSO.CreateTextFile(TempFiles)
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set CPU = objWMIService.ExecQuery("Select * From Win32_Processor")
For Each Item In CPU
CPU2 = "CPU:" & Item.Name
Next
Set Board = objWMIService.ExecQuery("Select * From Win32_BaseBoard")
For Each Item In Board
Board2 = "主板: " & Item.Product
Next
Set colItems = objWMIService.ExecQuery("Select * From Win32_PhysicalMemory",,48)
For Each objItem In colItems
A = objItem.Capacity/1048576
Temp = temp+objItem.Capacity
N = N+1
Next
Memory = Temp/1048576
If N = 1 Then
Memory2 = "内存: " & N & "条" & A & "M"
Else
Memory2 = "内存: " & N & "条" & A & "M" &" 总计" & Memory & "M"
End If
Set Video = objWMIService.ExecQuery("Select * From Win32_VideoController",,48)
For Each Item In Video
Video2 = "显卡: " & Item.Description
Video3 = "分辨率: " & Item.VideoModeDescription
Next
Set VideoA = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor",,48)
For Each Item In VideoA
VideoA = "显示器名称: " & Item.Description
VideoB = "屏幕高度: " & Item.ScreenHeight & " 屏幕宽度: " & Item.ScreenWidth
Next
Set Disk = objWMIService.ExecQuery("Select * From Win32_DiskDrive")
For Each Item In Disk
Disk2 = Disk2 & Item.Model
Disk4 = Int(Item.Size/1000/1000/1000) & "G"
Next
Disk3 = "硬盘: " & Trim(Disk2)
Disk5 = "硬盘容量: " & Disk4
Set Network = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each Item In Network
Lan = "网卡: " & Item.Description
IP = "IP地址: " & Item.IPAddress(0)
MacAdd = "MAC地址:" & Item.MACAddress
Next