码迷,mamicode.com
首页 > 其他好文 > 详细

[VBS]检测计算机各硬件信息

时间:2015-07-30 16:39:15      阅读:254      评论:0      收藏:0      [点我收藏+]

标签:

1)批处理脚本:Rhea_HardwareInfoCollector.bat

调用VBScript脚本Rhea_HardwareInfoCollector.vbs,并将结果打印到文件Rhea_Result.txt

@if exist Rhea_Result.txt (del Rhea_Result.txt)
@cscript Rhea_HardwareInfoCollector.vbs >> Rhea_Result.txt
@echo "结果已打印到 Rhea_Result.txt"
@pause

2)VBScript脚本:Rhea_HardwareInfoCollector.bat

On Error Resume Next
 
If WScript.Arguments.Count >= 1 Then
    Select Case WScript.Arguments(0) 
        Case "-e", "--execute"
        Case "-v", "--version" 
            WScript.Echo "程序版本:1.0.0.0"
            WScript.Echo "作者标识:Tsybius2014"
            WScript.Echo "作者主页:http://my.oschina.net/Tsybius2014/"
            WScript.Echo
            WScript.Quit(0)
        Case "-h", "--help"
            WScript.Echo "进行检查:Rhea_HardwareInfoCollector.vbs [-e|--execute]"
            WScript.Echo "查看帮助:Rhea_HardwareInfoCollector.vbs [-h|--help]"
            WScript.Echo "查看版本:Rhea_HardwareInfoCollector.vbs [-v|--version]"
            WScript.Echo
            WScript.Quit(0)
    End Select
End If
 
Set WMI = GetObject("Winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
 
Dim i, j, k
 
StartTime = Now
 
SystemOverview
ProcessorInfo
BaseBoardInfo
MemoryInfo
DiskInfo
GraphicsInfo
DisplayInfo
SoundCardInfo
NetworkCardInfo
KeyBoardInfo
BatteryInfo
PointingDeviceInfo
CDROMDriveInfo
OtherHardware
 
FinishTime = Now
RunStats
 
WScript.Echo 
 
打印标题
Sub SetTitle(TitleName)
 
    Dim Title : Title = TitleName
    For i = 0 To 9
        Title = "" & Title & ""
    Next
    WScript.Echo Title
     
End Sub
 
系统概览参考:https://msdn.microsoft.com/en-us/library/aa394102%28VS.85%29.aspx
Sub SystemOverview
 
    SetTitle "1.系统概览"
     
    Set Computers = WMI.ExecQuery("Select * from Win32_ComputerSystem")
    For Each Computer in Computers
     
        Wscript.Echo "生产厂家:" & Computer.Manufacturer
        Wscript.Echo "当前用户:" & Computer.UserName
         
    Next
     
    WScript.Echo 
     
End Sub
 
处理器信息参考:https://msdn.microsoft.com/en-us/library/aa394373%28VS.85%29.aspx
Sub ProcessorInfo
 
    SetTitle "2.处理器信息"
     
    Set CPUs = WMI.InstancesOf("Win32_Processor")
    For Each CPU In CPUs
     
        WScript.Echo "设备名称: " & CPU.Name
        WScript.Echo "设备描述: " & CPU.Description
        WScript.Echo "设备说明: " & CPU.Caption
        WScript.Echo "处理器标识: " & CPU.ProcessorId
         
        Dim ProcessorType : ProcessorType = "处理器类型:"
        Select Case CPU.ProcessorType 
            Case 1 : ProcessorType = ProcessorType & "Other"
            Case 2 : ProcessorType = ProcessorType & "Unknown"
            Case 3 : ProcessorType = ProcessorType & "Central Processor"
            Case 4 : ProcessorType = ProcessorType & "Math Processor"
            Case 5 : ProcessorType = ProcessorType & "DSP Processor"
            Case 6 : ProcessorType = ProcessorType & "Video Processor"
            Case Else : ProcessorType = ProcessorType & "[Type]" & CPU.ProcessorType
        End Select
        WScript.Echo ProcessorType
         
        WScript.Echo "处理器版本: " & CPU.Version
        WScript.Echo "唯一标识: " & CPU.UniqueId
        WScript.Echo "设备标识: " & CPU.DeviceID
         
        Dim Family : Family = "处理器家族:"
        Select Case CPU.Family 
             
            Case 1 : Family =  Family & "Other"
            Case 2 : Family =  Family & "Unknown"
            Case 3 : Family =  Family & "8086"
            Case 4 : Family =  Family & "80286"
            Case 5 : Family =  Family & "Intel386(TM) Processor"
            Case 6 : Family =  Family & "Intel486(TM) Processor"
            Case 7 : Family =  Family & "8087"
            Case 8 : Family =  Family & "80287"
            Case 9 : Family =  Family & "80387"
             
            Case 10 : Family =  Family & "80487"
            Case 11 : Family =  Family & "Pentium Brand"
            Case 12 : Family =  Family & "Pentium Pro"
            Case 13 : Family =  Family & "Pentium II"
            Case 14 : Family =  Family & "Pentium Processor with MMX(TM) Technology"
            Case 15 : Family =  Family & "Celeron(TM)"
            Case 16 : Family =  Family & "Pentium II Xeon(TM)"
            Case 17 : Family =  Family & "Pentium III"
            Case 18 : Family =  Family & "M1 Family"
            Case 19 : Family =  Family & "M2 Family"
             
            Case 24 : Family =  Family & "AMD Duron(TM) Processor Family"
            Case 25 : Family =  Family & "K5 Family"
            Case 26 : Family =  Family & "K6 Family"
            Case 27 : Family =  Family & "K6-2"
            Case 28 : Family =  Family & "K6-3"
            Case 29 : Family =  Family & "AMD Athlon(TM) Processor Family"
         
            Case 30 : Family =  Family & "AMD2900 Family"
            Case 31 : Family =  Family & "K6-2+"
            Case 32 : Family =  Family & "Power PC Family"
            Case 33 : Family =  Family & "Power PC 601"
            Case 34 : Family =  Family & "Power PC 603"
            Case 35 : Family =  Family & "Power PC 603+"
            Case 36 : Family =  Family & "Power PC 604"
            Case 37 : Family =  Family & "Power PC 620"
            Case 38 : Family =  Family & "Power PC X704"
            Case 39 : Family =  Family & "Power PC 750"
             
            Case 48 : Family =  Family & "Alpha Family"
            Case 49 : Family =  Family & "Alpha 21064"
            Case 50 : Family =  Family & "Alpha 21066"
            Case 51 : Family =  Family & "Alpha 21164"
            Case 52 : Family =  Family & "Alpha 21164PC"
            Case 53 : Family =  Family & "Alpha 21164a"
            Case 54 : Family =  Family & "Alpha 21264"
            Case 55 : Family =  Family & "Alpha 21364"
             
            Case 64 : Family =  Family & "MIPS Family"
            Case 65 : Family =  Family & "MIPS R4000"
            Case 66 : Family =  Family & "MIPS R4200"
            Case 67 : Family =  Family & "MIPS R4400"
            Case 68 : Family =  Family & "MIPS R4600"
            Case 69 : Family =  Family & "MIPS R10000"
             
            Case 80 : Family =  Family & "SPARC Family"
            Case 81 : Family =  Family & "SuperSPARC"
            Case 82 : Family =  Family & "microSPARC II"
            Case 83 : Family =  Family & "microSPARC IIep"
            Case 84 : Family =  Family & "UltraSPARC"
            Case 85 : Family =  Family & "UltraSPARC II"
            Case 86 : Family =  Family & "UltraSPARC IIi"
            Case 87 : Family =  Family & "UltraSPARC III"
            Case 88 : Family =  Family & "UltraSPARC IIIi"
             
            Case 96 : Family =  Family & "68040"
            Case 97 : Family =  Family & "68xxx Family"
            Case 98 : Family =  Family & "68000"
            Case 99 : Family =  Family & "68010"
             
            Case 100 : Family =  Family & "68020"
            Case 101 : Family =  Family & "68030"
            Case 112 : Family =  Family & "Hobbit Family"
            Case 120 : Family =  Family & "Crusoe(TM) TM5000 Family"
            Case 121 : Family =  Family & "Crusoe(TM) TM3000 Family"
            Case 122 : Family =  Family & "Efficeon(TM) TM8000 Family"
            Case 128 : Family =  Family & "Weitek"
             
            Case 130 : Family =  Family & "Itanium(TM) Processor"
            Case 131 : Family =  Family & "AMD Athlon(TM) 64 Processor Family"
            Case 132 : Family =  Family & "AMD Opteron(TM) Processor Family"
            Case 144 : Family =  Family & "PA-RISC Family"
            Case 145 : Family =  Family & "PA-RISC 8500"
            Case 146 : Family =  Family & "PA-RISC 8000"
            Case 147 : Family =  Family & "PA-RISC 7300LC"
            Case 148 : Family =  Family & "PA-RISC 7200"
            Case 149 : Family =  Family & "PA-RISC 7100LC"
            Case 150 : Family =  Family & "PA-RISC 7100"
            Case 160 : Family =  Family & "V30 Family"
             
            Case 176 : Family =  Family & "Pentium III Xeon(TM) Processor"
            Case 177 : Family =  Family & "Pentium III Processor with Intel SpeedStep(TM) Technology"
            Case 178 : Family =  Family & "Pentium 4"
            Case 179 : Family =  Family & "Intel Xeon(TM)"
            Case 180 : Family =  Family & "AS400 Family"
            Case 181 : Family =  Family & "Intel Xeon(TM) Processor MP"
            Case 182 : Family =  Family & "AMD Athlon(TM) XP Family"
            Case 183 : Family =  Family & "AMD Athlon(TM) MP Family"
            Case 184 : Family =  Family & "Intel Itanium 2"
            Case 185 : Family =  Family & "Intel Pentium M Processor"
            Case 190 : Family =  Family & "K7"
            Case 198 : Family =  Family & "Intel Core(TM) i7-2760QM"
             
            Case 200 : Family =  Family & "IBM390 Family"
            Case 201 : Family =  Family & "G4"
            Case 202 : Family =  Family & "G5"
            Case 203 : Family =  Family & "G6"
            Case 204 : Family =  Family & "z/Architecture Base"
            Case 250 : Family =  Family & "i860"
            Case 251 : Family =  Family & "i960"
            Case 260 : Family =  Family & "SH-3"
            Case 261 : Family =  Family & "SH-4"
            Case 280 : Family =  Family & "ARM"
            Case 281 : Family =  Family & "StrongARM"
             
            Case 300 : Family =  Family & "6x86"
            Case 301 : Family =  Family & "MediaGX"
            Case 302 : Family =  Family & "MII"
            Case 320 : Family =  Family & "WinChip"
            Case 350 : Family =  Family & "DSP"
            Case 500 : Family =  Family & "Video Processor"
            Case Else : Family = Family & "[Family Type] " & CPU.Family
        End Select 
        WScript.Echo Family
         
        Dim Architecture : Architecture = "处理器架构:"
        Select Case CPU.Architecture 
            Case 0 : Architecture = Architecture & "x86"
            Case 1 : Architecture = Architecture & "MIPS"
            Case 2 : Architecture = Architecture & "Alpha"
            Case 3 : Architecture = Architecture & "PowerPC"
            Case 5 : Architecture = Architecture & "ARM"
            Case 6 : Architecture = Architecture & "Itanium-based systems"
            Case 9 : Architecture = Architecture & "x64"
            Case Else : Architecture = Architecture & "[Architecture] " & CPU.Architecture
        End Select
        WScript.Echo Architecture
         
        WScript.Echo "-"
         
        WScript.Echo "内核数量: " & CPU.NumberOfCores 
        WScript.Echo "逻辑处理器数量: " & CPU.NumberOfLogicalProcessors 
        WScript.Echo "地址长度: " & CPU.AddressWidth
        WScript.Echo "数据长度: " & CPU.DataWidth
        WScript.Echo "处理速度: " & CPU.CurrentClockSpeed & " MHz"
        WScript.Echo "L2缓存: " & CPU.L2CacheSize & " B"
        WScript.Echo "L3缓存: " & CPU.L3CacheSize & " B"
         
         
        WScript.Echo "-"
         
        Dim CpuStatus : CpuStatus = "处理器状态:"
        Select Case CPU.CpuStatus 
            Case 0 : CpuStatus = CpuStatus & "Unknown"
            Case 1 : CpuStatus = CpuStatus & "CPU Enabled"
            Case 2 : CpuStatus = CpuStatus & "CPU Disabled by User via BIOS Setup"
            Case 3 : CpuStatus = CpuStatus & "CPU Disabled by BIOS (POST Error)"
            Case 4 : CpuStatus = CpuStatus & "CPU Is Idle"
            Case 5 : CpuStatus = CpuStatus & "Reserved"
            Case 6 : CpuStatus = CpuStatus & "Reserved"
            Case 7 : CpuStatus = CpuStatus & "Other"
            Case Else : CpuStatus = CpuStatus & "[CpuStatus] " & CPU.CpuStatus
        End Select
        WScript.Echo CpuStatus
 
        WScript.Echo "="
         
    Next
     
    WScript.Echo 
     
End Sub
 
主板信息参考:https://msdn.microsoft.com/en-us/library/aa394072%28VS.85%29.aspx
Sub BaseBoardInfo
 
    SetTitle "3.主板信息"
     
    Set BaseBoards = WMI.InstancesOf("Win32_BaseBoard")
    For Each BaseBoard In BaseBoards
     
        WScript.Echo "设备名称: " & BaseBoard.Name
        WScript.Echo "设备描述: " & BaseBoard.Description
        WScript.Echo "设备说明: " & BaseBoard.Caption
        WScript.Echo "主板型号: " & BaseBoard.Product  
        WScript.Echo "主板版本: " & BaseBoard.Version
        WScript.Echo "制造厂商: " & BaseBoard.Manufacturer
        WScript.Echo "序列号码: " & BaseBoard.SerialNumber
         
        WScript.Echo "-"
         
        WScript.Echo "是否底板: " & BaseBoard.HostingBoard 
        WScript.Echo "可热插拔: " & BaseBoard.HotSwappable  
        WScript.Echo "是否开启: " & BaseBoard.PoweredOn
        WScript.Echo "可拆卸性: " & BaseBoard.Removable
        WScript.Echo "可替换性: " & BaseBoard.Replaceable
         
        WScript.Echo "-"
         
        WScript.Echo "硬件状态: " & BaseBoard.Status
         
        WScript.Echo "="
         
    Next
     
    WScript.Echo 
     
End Sub
 
内存信息参考:https://msdn.microsoft.com/en-us/library/aa394347%28VS.85%29.aspx
Sub MemoryInfo
 
    SetTitle "4.内存信息"
     
    Set Memorys = WMI.InstancesOf("Win32_PhysicalMemory")
     
    For Each Memory In Memorys
             
        WScript.Echo "设备名称: " & Memory.Name
        WScript.Echo "设备描述: " & Memory.Description 
        WScript.Echo "设备说明: " & Memory.Caption
        WScript.Echo "制造厂商: " & Memory.Manufacturer
        WScript.Echo "序列号码: " & Memory.SerialNumber
         
        WScript.Echo "-"
         
        WScript.Echo "数据宽度: " & Memory.DataWidth
         
        Dim FormFactor : FormFactor = "形状系数:"
        Select Case Memory.FormFactor 
            Case 0 : FormFactor = FormFactor & "Unknown"
            Case 1 : FormFactor = FormFactor & "Other"
            Case 2 : FormFactor = FormFactor & "SIP"
            Case 3 : FormFactor = FormFactor & "DIP"
            Case 4 : FormFactor = FormFactor & "ZIP"
            Case 5 : FormFactor = FormFactor & "SOJ"
            Case 6 : FormFactor = FormFactor & "Proprietary"
            Case 7 : FormFactor = FormFactor & "SIMM"
            Case 8 : FormFactor = FormFactor & "DIMM"
            Case 9 : FormFactor = FormFactor & "TSOP"
            Case 10 : FormFactor = FormFactor & "PGA"
            Case 11 : FormFactor = FormFactor & "RIMM"
            Case 12 : FormFactor = FormFactor & "SODIMM"
            Case 13 : FormFactor = FormFactor & "SRIMM"
            Case 14 : FormFactor = FormFactor & "SMD"
            Case 15 : FormFactor = FormFactor & "SSMP"
            Case 16 : FormFactor = FormFactor & "SFP"
            Case 17 : FormFactor = FormFactor & "TQFP"
            Case 18 : FormFactor = FormFactor & "SOIC"
            Case 19 : FormFactor = FormFactor & "LCC"
            Case 20 : FormFactor = FormFactor & "PLCC"
            Case 21 : FormFactor = FormFactor & "BGA"
            Case 22 : FormFactor = FormFactor & "FPBGA"
            Case 23 : FormFactor = FormFactor & "LGA"
            Case Else : FormFactor = FormFactor & "[FormFactor] " & Memory.FormFactor 
        End Select 
        WScript.Echo FormFactor
         
        WScript.Echo "容量统计: " & Memory.Capacity / 1024 / 1024 & "MB"
         
        Dim MemoryType : MemoryType = "内存类型: "
        Select Case Memory.MemoryType 
            Case 0 : MemoryType = MemoryType & "Unknown"
            Case 1 : MemoryType = MemoryType & "Other"
            Case 2 : MemoryType = MemoryType & "DRAM"
            Case 3 : MemoryType = MemoryType & "Synchronous DRAM"
            Case 4 : MemoryType = MemoryType & "Cache DRAM"
            Case 5 : MemoryType = MemoryType & "EDO"
            Case 6 : MemoryType = MemoryType & "EDRAM"
            Case 7 : MemoryType = MemoryType & "VRAM"
            Case 8 : MemoryType = MemoryType & "SRAM"
            Case 9 : MemoryType = MemoryType & "RAM"
            Case 10 : MemoryType = MemoryType & "ROM"
            Case 11 : MemoryType = MemoryType & "Flash"
            Case 12 : MemoryType = MemoryType & "EEPROM"
            Case 13 : MemoryType = MemoryType & "FEPROM"
            Case 14 : MemoryType = MemoryType & "EPROM"
            Case 15 : MemoryType = MemoryType & "CDRAM"
            Case 16 : MemoryType = MemoryType & "3DRAM"
            Case 17 : MemoryType = MemoryType & "SDRAM"
            Case 18 : MemoryType = MemoryType & "SGRAM"
            Case 19 : MemoryType = MemoryType & "RDRAM"
            Case 20 : MemoryType = MemoryType & "DDR"
            Case 21 : MemoryType = MemoryType & "DDR-2"
            Case Else : MemoryType = MemoryType & "[MemoryType] " & Memory.MemoryType 
        End Select
        WScript.Echo MemoryType
         
        WScript.Echo "安放位置: " & Memory.DeviceLocator
        WScript.Echo "行中位置: " & Memory.PositionInRow
         
        WScript.Echo "-"
         
    Next
     
    WScript.Echo 
     
End Sub
 
硬盘信息参考:https://msdn.microsoft.com/en-us/library/aa394132%28VS.85%29.aspx
Sub DiskInfo
 
    SetTitle "5.硬盘信息"
     
    Set Disks = WMI.ExecQuery("Select * from Win32_DiskDrive WHERE InterfaceType=‘IDE‘")
    For Each Disk In Disks
         
        WScript.Echo "设备名称:" & Disk.Name
        WScript.Echo "设备描述: " & Disk.Description 
        WScript.Echo "设备说明: " & Disk.Caption 
        WScript.Echo "硬盘名称:" & Disk.Caption
        WScript.Echo "生产厂家:" & Disk.Manufacturer
        WScript.Echo "硬盘序列号:" & Disk.SerialNumber
        WScript.Echo "硬盘签名:" & Disk.Signature
         
        WScript.Echo "硬盘具有以下能力:"
        For Each Capability In Disk.Capabilities
            Select Case Capability
                Case 0 : WScript.Echo "Unknown"
                Case 1 : WScript.Echo "Other"
                Case 2 : WScript.Echo "Sequential Access"
                Case 3 : WScript.Echo "Random Access"
                Case 4 : WScript.Echo "Supports Writing"
                Case 5 : WScript.Echo "Encryption"
                Case 6 : WScript.Echo "Compression"
                Case 7 : WScript.Echo "Supports Removable Media"
                Case 8 : WScript.Echo "Manual Cleaning"
                Case 9 : WScript.Echo "Automatic Cleaning"
                Case 10 : WScript.Echo "SMART Notification"
                Case 11 : WScript.Echo "Supports Dual-Sided Media"
                Case 12 : WScript.Echo "Ejection Prior to Drive Dismount Not Required"
                Case Else : WScript.Echo "-"
            End Select
        Next
         
        WScript.Echo "-"
     
        WScript.Echo "硬盘默认分块大小:" & Disk.DefaultBlockSize
        WScript.Echo "硬盘最大分块大小:" & Disk.MaxBlockSize
        WScript.Echo "硬盘最小分块大小:" & Disk.MinBlockSize
        WScript.Echo "硬盘扇区数:" & Disk.SectorsPerTrack
 
        WScript.Echo "硬盘柱面数:" & Disk.TotalCylinders
        WScript.Echo "硬盘总头数:" & Disk.TotalHeads
        WScript.Echo "硬盘扇区数:" & Disk.TotalSectors
        WScript.Echo "硬盘总道数:" & Disk.TotalTracks
        WScript.Echo "硬盘总道数:" & Disk.TotalTracks
        WScript.Echo "每柱磁道数:" & Disk.TracksPerCylinder
         
     
        WScript.Echo "固件版本:" & Disk.FirmwareRevision
        WScript.Echo "接口类型:" & Disk.InterfaceType
         
        WScript.Echo "-"
     
        WScript.Echo "硬盘容量:" & FormatNumber(Disk.Size / 1024 / 1024 / 1024, 3) & " GB"
         
        WScript.Echo "="
         
    Next
     
    WScript.Echo 
     
End Sub
 
显卡信息参考:https://msdn.microsoft.com/en-us/library/aa394512%28VS.85%29.aspx
Sub GraphicsInfo
 
    SetTitle "6.显卡信息"
     
    Set VIDs = WMI.ExecQuery("SELECT DeviceID FROM Win32_VideoController")
    For Each VID In VIDs
         
        Set Videos = WMI.ExecQuery("SELECT * FROM Win32_VideoController WHERE DeviceID=‘"& VID.DeviceID &"")
        For Each Video In Videos
         
            WScript.Echo "设备名称: " & Video.Name
            WScript.Echo "设备描述: " & Video.Description 
            WScript.Echo "设备说明: " & Video.Caption
            WScript.Echo "制造厂商: " & Video.AdapterCompatibility
             
            Dim VideoArchitecture : VideoArchitecture = "视频架构:"
            Select Case Video.VideoArchitecture 
                Case 1 : VideoArchitecture = VideoArchitecture & "Other"
                Case 2 : VideoArchitecture = VideoArchitecture & "Unknown"
                Case 3 : VideoArchitecture = VideoArchitecture & "CGA"
                Case 4 : VideoArchitecture = VideoArchitecture & "EGA"
                Case 5 : VideoArchitecture = VideoArchitecture & "VGA"
                Case 6 : VideoArchitecture = VideoArchitecture & "SVGA"
                Case 7 : VideoArchitecture = VideoArchitecture & "MDA"
                Case 8 : VideoArchitecture = VideoArchitecture & "HGC"
                Case 9 : VideoArchitecture = VideoArchitecture & "MCGA"
                Case 10 : VideoArchitecture = VideoArchitecture & "8514A"
                Case 11 : VideoArchitecture = VideoArchitecture & "XGA"
                Case 12 : VideoArchitecture = VideoArchitecture & "Linear Frame Buffer"
                Case 160 : VideoArchitecture = VideoArchitecture & "PC-98"
                Case Else : VideoArchitecture = VideoArchitecture & "[VideoArchitecture] " & Video.VideoArchitecture 
            End Select
            WScript.Echo VideoArchitecture
             
            Dim VideoMemoryType : VideoMemoryType = "视频存储器类型:"
            Select Case Video.VideoMemoryType
                Case 1 : VideoMemoryType = VideoMemoryType & "Other"
                Case 2 : VideoMemoryType = VideoMemoryType & "Unknown"
                Case 3 : VideoMemoryType = VideoMemoryType & "VRAM"
                Case 4 : VideoMemoryType = VideoMemoryType & "DRAM"
                Case 5 : VideoMemoryType = VideoMemoryType & "SRAM"
                Case 6 : VideoMemoryType = VideoMemoryType & "WRAM"
                Case 7 : VideoMemoryType = VideoMemoryType & "EDO RAM"
                Case 8 : VideoMemoryType = VideoMemoryType & "Burst Synchronous DRAM"
                Case 9 : VideoMemoryType = VideoMemoryType & "Pipelined Burst SRAM"
                Case 10 : VideoMemoryType = VideoMemoryType & "CDRAM"
                Case 11 : VideoMemoryType = VideoMemoryType & "3DRAM"
                Case 12 : VideoMemoryType = VideoMemoryType & "SDRAM"
                Case 13 : VideoMemoryType = VideoMemoryType & "SGRAM"
                Case Else : VideoMemoryType = VideoMemoryType & "[VideoMemoryType] " & Video.VideoMemoryType 
            End Select
            Wscript.Echo VideoMemoryType
             
            WScript.Echo "视频处理器: " & Video.VideoProcessor
             
            WScript.Echo "-"
     
            WScript.Echo "物理显存: " & Round(Video.AdapterRAM / 1024 / 1024)&" MB"
            WScript.Echo "分辨率: " & Video.CurrentHorizontalResolution & " * " & Video.CurrentVerticalResolution
            WScript.Echo "单位像素比特数:" & Video.CurrentBitsPerPixel & " Bit"
            WScript.Echo "刷新频率: " & Video.CurrentRefreshRate & " Hz"
             
            WScript.Echo "="
             
        Next
        Set Videos = Nothing
         
    Next
    Set VIDs = Nothing
     
    WScript.Echo 
     
End Sub
 
显示器信息参考:https://msdn.microsoft.com/en-us/library/aa394122%28VS.85%29.aspx
Sub DisplayInfo
 
    SetTitle "7.显示器信息"
     
    显示器信息
    Set Monitors = WMI.ExecQuery("Select * from Win32_DesktopMonitor")
    For Each Monitor In Monitors
         
        WScript.Echo "设备名称: " & Monitor.Name
        WScript.Echo "设备描述: " & Monitor.Description 
        WScript.Echo "设备说明: " & Monitor.Caption
        WScript.Echo "显示器类型: " & Monitor.MonitorType
        WScript.Echo "生产厂家: " & Monitor.MonitorManufacturer
         
        WScript.Echo "-"
     
        WScript.Echo "屏幕高度: " & Monitor.ScreenHeight
        WScript.Echo "屏幕宽度: " & Monitor.ScreenWidth
        WScript.Echo "X轴每逻辑英寸像素数: " & Monitor.PixelsPerXLogicalInch
        WScript.Echo "Y轴每逻辑英寸像素数: " & Monitor.PixelsPerYLogicalInch
         
        Dim DisplayType : DisplayType = "显示模式:"
        Select Case Monitor.DisplayType
            Case 0 : DisplayType = DisplayType & "Unknown"
            Case 1 : DisplayType = DisplayType & "Other"
            Case 2 : DisplayType = DisplayType & "Multiscan Color"
            Case 3 : DisplayType = DisplayType & "Multiscan Monochrome"
            Case 4 : DisplayType = DisplayType & "Fixed Frequency Color"
            Case 5 : DisplayType = DisplayType & "Fixed Frequency Monochrome"
            Case Else : DisplayType = DisplayType & "[DisplayType] " & Monitor.DisplayType 
        End Select
        Wscript.Echo DisplayType
         
        Dim StatusInfo : StatusInfo = "状态信息:"
        Select Case Monitor.StatusInfo
            Case 1 : StatusInfo = StatusInfo & "Other"
            Case 2 : StatusInfo = StatusInfo & "Unknown"
            Case 3 : StatusInfo = StatusInfo & "Enabled"
            Case 4 : StatusInfo = StatusInfo & "Disabled"
            Case 5 : StatusInfo = StatusInfo & "Not Applicable"
            Case Else : StatusInfo = StatusInfo & "[StatusInfo] " & Monitor.StatusInfo 
        End Select
        Wscript.Echo StatusInfo
         
        WScript.Echo "="
             
    Next
     
    WScript.Echo 
     
End Sub
 
声卡信息参考:https://msdn.microsoft.com/en-us/library/aa394463%28VS.85%29.aspx
Sub SoundCardInfo
 
    SetTitle "8.声卡信息"
     
    声卡信息
    Set SoundDevices = WMI.ExecQuery("SELECT * FROM Win32_SoundDevice")
    For Each SoundDevice In SoundDevices
     
        WScript.Echo "设备名称: " & SoundDevice.Name
        WScript.Echo "设备描述: " & SoundDevice.Description 
        WScript.Echo "设备说明: " & SoundDevice.Caption 
        WScript.Echo "制造厂商: " & SoundDevice.Manufacturer
         
        Dim StatusInfo : StatusInfo = "状态信息:"
        Select Case SoundDevice.StatusInfo
            Case 1 : StatusInfo = StatusInfo & "Other"
            Case 2 : StatusInfo = StatusInfo & "Unknown"
            Case 3 : StatusInfo = StatusInfo & "Enabled"
            Case 4 : StatusInfo = StatusInfo & "Disabled"
            Case 5 : StatusInfo = StatusInfo & "Not Applicable"
            Case Else : StatusInfo = StatusInfo & "[StatusInfo] " & SoundDevice.StatusInfo 
        End Select
        Wscript.Echo StatusInfo
         
        WScript.Echo "="
             
    Next
    Set SoundDevices = Nothing
     
    WScript.Echo 
     
End Sub
 
网卡信息参考:https://msdn.microsoft.com/en-us/library/aa394216%28v=vs.85%29.aspx
Sub NetworkCardInfo
 
    SetTitle "9.网卡信息"
     
    网卡信息
    Set Networks = WMI.ExecQuery("Select * from Win32_NetworkAdapter WHERE PhysicalAdapter =‘TRUE‘")
    For Each Network In Networks
     
        WScript.Echo "设备名称: " & Network.Name 
        WScript.Echo "设备描述: " & Network.Description 
        WScript.Echo "设备说明: " & Network.Caption 
        WScript.Echo "适配器型号: " & Network.AdapterType 
        WScript.Echo "生产厂商: " & Network.Manufacturer 
        WScript.Echo "设备标识: " & Network.DeviceID 
         
        WScript.Echo "GUID: "& Network.GUID 
        WScript.Echo "MAC: "& Network.MACAddress 
         
        WScript.Echo "-"
         
        If Network.NetEnabled = TRUE Then
            WScript.Echo "活跃状态:" & "活跃"
        Else
            WScript.Echo "活跃状态:" & "空闲"
        End If 
         
        Dim NetConnectionStatus : NetConnectionStatus = "状态信息:"
        Select Case Network.NetConnectionStatus
            Case 0 : NetConnectionStatus = NetConnectionStatus & "Disconnected"
            Case 1 : NetConnectionStatus = NetConnectionStatus & "Connecting"
            Case 2 : NetConnectionStatus = NetConnectionStatus & "Connected"
            Case 3 : NetConnectionStatus = NetConnectionStatus & "Disconnecting"
            Case 4 : NetConnectionStatus = NetConnectionStatus & "Hardware not present"
            Case 5 : NetConnectionStatus = NetConnectionStatus & "Hardware disabled"
            Case 6 : NetConnectionStatus = NetConnectionStatus & "Hardware malfunction"
            Case 7 : NetConnectionStatus = NetConnectionStatus & "Media disconnected"
            Case 8 : NetConnectionStatus = NetConnectionStatus & "Authenticating"
            Case 9 : NetConnectionStatus = NetConnectionStatus & "Authentication succeeded"
            Case 10 : NetConnectionStatus = NetConnectionStatus & "Authentication failed"
            Case 11 : NetConnectionStatus = NetConnectionStatus & "Invalid address"
            Case 12 : NetConnectionStatus = NetConnectionStatus & "Credentials required"
            Case Else : NetConnectionStatus = NetConnectionStatus & "[NetConnectionStatus] " & Network.NetConnectionStatus 
        End Select
        Wscript.Echo NetConnectionStatus
         
        WScript.Echo "="
             
    Next
    Set cNet = Nothing
     
    WScript.Echo 
     
End Sub
 
键盘信息参考:https://msdn.microsoft.com/en-us/library/aa394166%28v=vs.85%29.aspx
Sub KeyBoardInfo
 
    SetTitle "10.键盘信息"
     
    Set Keyboards = WMI.ExecQuery("Select * from Win32_Keyboard")
    For Each Keyboard In Keyboards
     
        WScript.Echo "设备名称: " & Keyboard.Name 
        WScript.Echo "设备描述: " & Keyboard.Description  
        WScript.Echo "设备说明: " & Keyboard.Caption 
        WScript.Echo "功能键数量: " & Keyboard.NumberOfFunctionKeys 
     
    Next
     
    WScript.Echo 
     
End Sub
 
电池信息
Sub BatteryInfo
 
    SetTitle "11.电池信息"
     
    Set Batterys = WMI.ExecQuery("Select * from Win32_Battery")
    For Each Battery In Batterys
         
        WScript.Echo "设备名称: "& Battery.Name 
        WScript.Echo "设备描述: "& Battery.Description
        WScript.Echo "设备说明: " & Battery.Caption  
         
        Dim Chemistry : Chemistry = "电池类型:"
        Select Case Battery.Chemistry
            Case 1 : Chemistry = Chemistry & "Other"
            Case 2 : Chemistry = Chemistry & "Unknown"
            Case 3 : Chemistry = Chemistry & "Lead Acid"
            Case 4 : Chemistry = Chemistry & "Nickel Cadmium"
            Case 5 : Chemistry = Chemistry & "Nickel Metal Hydride"
            Case 6 : Chemistry = Chemistry & "Lithium-ion"
            Case 7 : Chemistry = Chemistry & "Zinc air"
            Case 8 : Chemistry = Chemistry & "Lithium Polymer"
            Case Else : Chemistry = Chemistry & "[Chemistry] " & Battery.Chemistry 
        End Select
        WScript.Echo Chemistry
             
        WScript.Echo "设计容量: " & Battery.DesignCapacity & " milliwatt-hour(s)"
        WScript.Echo "设计电压: " & Battery.DesignVoltage & " millivolt(s)" 
    Next
     
    WScript.Echo 
     
End Sub
 
 
指示设备信息参考:https://msdn.microsoft.com/en-us/library/aa394356.aspx
Sub PointingDeviceInfo
 
    SetTitle "12.指示设备信息"
     
    Set PointingDevices = WMI.ExecQuery("Select * from Win32_PointingDevice")
    For Each PointingDevice In PointingDevices
         
        WScript.Echo "设备名称: "& PointingDevice.Name 
        WScript.Echo "设备描述: "& PointingDevice.Description
        WScript.Echo "设备说明: " & PointingDevice.Caption  
        WScript.Echo "生产厂家: " & PointingDevice.Manufacturer  
         
        Dim DeviceInterface : DeviceInterface = ""
        Select Case PointingDevice.DeviceInterface
            Case 1 : DeviceInterface = DeviceInterface & "Other"
            Case 2 : DeviceInterface = DeviceInterface & "Unknown"
            Case 3 : DeviceInterface = DeviceInterface & "Serial"
            Case 4 : DeviceInterface = DeviceInterface & "PS/2"
            Case 5 : DeviceInterface = DeviceInterface & "Infrared"
            Case 6 : DeviceInterface = DeviceInterface & "HP-HIL"
            Case 7 : DeviceInterface = DeviceInterface & "Bus Mouse"
            Case 8 : DeviceInterface = DeviceInterface & "ADB (Apple Desktop Bus)"
            Case 160 : DeviceInterface = DeviceInterface & "Bus Mouse DB-9"
            Case 161 : DeviceInterface = DeviceInterface & "Bus Mouse Micro-DIN"
            Case 162 : DeviceInterface = DeviceInterface & "USB"
            Case Else : DeviceInterface = DeviceInterface & "[DeviceInterface] " & PointingDevice.DeviceInterface 
        End Select
        WScript.Echo DeviceInterface
         
        WScript.Echo "硬件类型: " & PointingDevice.HardwareType 
         
        WScript.Echo "="
         
    Next
     
    WScript.Echo 
 
End Sub
 
光驱设备参考:https://msdn.microsoft.com/en-us/library/aa394081.aspx
Sub CDROMDriveInfo
 
    SetTitle "13.光驱设备"
     
    Set CDROMDrives = WMI.ExecQuery("Select * from Win32_CDROMDrive")
    For Each CDROMDrive In CDROMDrives
     
        WScript.Echo "设备名称: "& CDROMDrive.Name 
        WScript.Echo "设备描述: "& CDROMDrive.Description
        WScript.Echo "设备说明: " & CDROMDrive.Caption  
        WScript.Echo "生产厂家: " & CDROMDrive.Manufacturer
         
        WScript.Echo "="
         
    Next
 
    WScript.Echo 
 
End Sub
 
其他硬件
Sub OtherHardware
 
    SetTitle "其他信息"
     
    WScript.Echo 
     
End Sub
 
运行统计
Sub RunStats
 
    SetTitle "运行统计"
     
    WScript.Echo "检查开始时间:" & StartTime
    WScript.Echo "检查结束时间:" & FinishTime
    WScript.Echo "检查用时:" & DateDiff("s", StartTime, FinishTime) & ""
     
    WScript.Echo 
     
End Sub

3)打印结果:Rhea_Result.txt

Microsoft (R) Windows Script Host Version 5.8
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。
 
----------1.系统概览----------
生产厂家:Dell Inc.
当前用户:Tsybius-PC\Tsybius
 
----------2.处理器信息----------
设备名称: Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz
设备描述: x64 Family 6 Model 58 Stepping 9
设备说明: x64 Family 6 Model 58 Stepping 9
处理器标识: BFEBFBFF000306A9
处理器类型:Central Processor
处理器版本: 
设备标识: CPU0
处理器家族:[Family Type] 205
处理器架构:x64
-
内核数量: 2
逻辑处理器数量: 4
地址长度: 32
数据长度: 64
处理速度: 2601 MHz
L2缓存: 512 B
L3缓存: 3072 B
-
处理器状态:CPU Enabled
=
 
----------3.主板信息----------
设备名称: Base Board
设备描述: Base Board
设备说明: Base Board
主板型号: 0F5PHF
主板版本: A00
制造厂商: Dell Inc.
序列号码: /5NL2NX1/CN1296137U0037/
-
是否底板: True
可热插拔: False
是否开启: True
可拆卸性: False
可替换性: True
-
硬件状态: OK
=
 
----------4.内存信息----------
设备名称: Physical Memory
设备描述: Physical Memory
设备说明: Physical Memory
制造厂商: 830B
序列号码: 50E42805
-
数据宽度: 64
形状系数:SODIMM
容量统计: 4096MB
内存类型: Unknown
安放位置: Top Slot
行中位置: 1
-
 
----------5.硬盘信息----------
设备名称:\\.\PHYSICALDRIVE0
设备描述: 磁盘驱动器
设备说明: HGST HTS725050A7E630 ATA Device
硬盘名称:HGST HTS725050A7E630 ATA Device
生产厂家:(标准磁盘驱动器)
硬盘序列号:2020202020204654353641354a57323244365636
硬盘具有以下能力:
Random Access
Supports Writing
-
硬盘默认分块大小:
硬盘最大分块大小:
硬盘最小分块大小:
硬盘扇区数:63
硬盘柱面数:60801
硬盘总头数:255
硬盘扇区数:976768065
硬盘总道数:15504255
硬盘总道数:15504255
每柱磁道数:255
固件版本:GH2OA560
接口类型:IDE
-
硬盘容量:465.759 GB
=
 
----------6.显卡信息----------
设备名称: Intel(R) HD Graphics 4000
设备描述: Intel(R) HD Graphics 4000
设备说明: Intel(R) HD Graphics 4000
制造厂商: Intel Corporation
视频架构:VGA
视频存储器类型:Unknown
视频处理器: Intel(R) HD Graphics Family
-
物理显存: 1556 MB
分辨率: 1366 * 768
单位像素比特数:32 Bit
刷新频率: 59 Hz
=
 
----------7.显示器信息----------
设备名称: 通用即插即用监视器
设备描述: 通用即插即用监视器
设备说明: 通用即插即用监视器
显示器类型: 通用即插即用监视器
生产厂家: (标准监视器类型)
-
屏幕高度: 768
屏幕宽度: 1366
X轴每逻辑英寸像素数: 96
Y轴每逻辑英寸像素数: 96
显示模式:[DisplayType] 
状态信息:[StatusInfo] 
=
 
----------8.声卡信息----------
设备名称: 英特尔(R) 显示器音频
设备描述: 英特尔(R) 显示器音频
设备说明: 英特尔(R) 显示器音频
制造厂商: Intel(R) Corporation
状态信息:Enabled
=
设备名称: IDT High Definition Audio CODEC
设备描述: IDT High Definition Audio CODEC
设备说明: IDT High Definition Audio CODEC
制造厂商: IDT
状态信息:Enabled
=
 
----------9.网卡信息----------
设备名称: Broadcom NetXtreme Gigabit Ethernet
设备描述: Broadcom NetXtreme Gigabit Ethernet
设备说明: [00000007] Broadcom NetXtreme Gigabit Ethernet
适配器型号: Ethernet 802.3
生产厂商: Broadcom
设备标识: 7
GUID: {9BC23D87-DADB-46E8-B542-DF0C6CAC7D7C}
MAC: F0:1F:AF:31:1A:A6
-
活跃状态:空闲
状态信息:Media disconnected
=
设备名称: Broadcom 802.11n 网络适配器
设备描述: Broadcom 802.11n 网络适配器
设备说明: [00000011] Broadcom 802.11n 网络适配器
适配器型号: Ethernet 802.3
生产厂商: Broadcom
设备标识: 11
GUID: {689F2877-B076-44D2-ACC6-74520D616695}
MAC: 70:18:8B:08:28:55
-
活跃状态:活跃
状态信息:Connected
=
设备名称: Microsoft Virtual WiFi Miniport Adapter
设备描述: Microsoft Virtual WiFi Miniport Adapter
设备说明: [00000015] Microsoft Virtual WiFi Miniport Adapter
适配器型号: Ethernet 802.3
生产厂商: Microsoft
设备标识: 15
GUID: {237CCDA1-169E-4F13-A9F2-B6AD0F6190A3}
MAC: 70:18:8B:08:28:55
-
活跃状态:空闲
状态信息:Media disconnected
=
 
----------10.键盘信息----------
设备名称: Enhanced (101- or 102-key)
设备描述: PS/2 标准键盘
设备说明: Enhanced (101- or 102-key)
功能键数量: 12
 
----------11.电池信息----------
设备名称: DELL MKD6223
设备描述: Internal Battery
设备说明: Internal Battery
电池类型:Lithium-ion
设计容量:  milliwatt-hour(s)
设计电压: 12436 millivolt(s)
 
----------12.指示设备信息----------
设备名称: USB 输入设备
设备描述: USB 输入设备
设备说明: USB 输入设备
生产厂家: (标准系统设备)
USB
硬件类型: USB 输入设备
=
设备名称: PS/2 兼容鼠标
设备描述: PS/2 兼容鼠标
设备说明: PS/2 兼容鼠标
生产厂家: Microsoft
PS/2
硬件类型: PS/2 兼容鼠标
=
 
----------13.光驱设备----------
设备名称: ZUPYDSN LARCTE3K SCSI CdRom Device
设备描述: CD-ROM Drive
设备说明: ZUPYDSN LARCTE3K SCSI CdRom Device
生产厂家: (标准 CD-ROM 驱动器)
=
设备名称: DTSOFT Virtual CdRom Device
设备描述: CD-ROM Drive
设备说明: DTSOFT Virtual CdRom Device
生产厂家: (标准 CD-ROM 驱动器)
=
 
----------运行统计----------
检查开始时间:2015/3/21 23:03:41
检查结束时间:2015/3/21 23:03:43
检查用时:2

 

[VBS]检测计算机各硬件信息

标签:

原文地址:http://www.cnblogs.com/masonlu/p/4689640.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!