Git Product home page Git Product logo

sondernextdoor / windowshardwareinfo Goto Github PK

View Code? Open in Web Editor NEW
111.0 6.0 50.0 1.13 MB

A project written in C++ to get hardware info on a Windows PC. Interfaces with the Windows Management Instrumentation (WMI) service to query hardware info of interest and provides a basic command line interface.

License: MIT License

C++ 98.98% C 1.02%
windows hardware info hwid command line disk cpu gpu smbios cpp wmi

windowshardwareinfo's Introduction

Windows-Hardware-Info

A project written in C++ to get hardware info on a Windows PC. Interfaces with the Windows Management Instrumentation (WMI) service to query hardware info of interest and provides a basic command line interface.

Retrieves the following:

Disks

Serial Number

Model

Interface Type

Bus Type

Drive Letter

Size

Free Space

Media Type

IsBootDrive

Volumes:

  • Name
  • Serial Number
  • Size
  • Free Space
  • Volume Letter

System Management BIOS (SMBIOS)

Serial Number

Manufacturer

Product

Version

GPUs

Name

Driver Version

Memory

Resolution

Refresh Rate

CPU

Processor Id

Manufacturer

Name

Number of Cores

Number of Logical Processors

Network Adapters

Name

MAC Address

System

Name

IsHypervisorPresent

OS Version

OS Name

OS Architecture

OS SerialNumber

Physical Memory

Part Number

Registry

Computer Hardware Id

Command Line

The command line interface is independent from the hardware logic and is only used to demonstrate functionality. All relevant hardware logic is in hwid.h

Valid Commands:

"disk" - prints all disk info

"smbios" - prints all SMBIOS info

"gpu" - prints all GPU info

"cpu" - prints all CPU info

"network" - prints all network adapter info

"system" - prints all system info

"physicalmemory" - prints all physical memory info

"registry" - prints all registry info

"all" - prints all info

"help" - opens this webpage on the default browser

"exit" - exits the program

Each of the above commands (except "all", "help" and "exit") can be used to retrieve fields from the hardware component they specify. To do so, the "get" keyword must follow one of the above commands. Valid field(s) should be specified after "get"

For example, "disk get serialnumber" would retrieve the disk serial number(s), while "disk get serialnumber, model" would retrieve the disk serial number(s), as well as the model(s).

Valid fields are as follows:

Disk:

serialnumber, model, interface, bustype, driveletter, size, freespace, mediatype, isbootdrive, volumes

SMBIOS:

serialnumber, manufacturer, product, version

GPU:

name, driverversion, memory, resolution, refreshrate

CPU:

processorid, manufacturer, name, cores, threads

Network:

name, mac

System:

name, ishypervisorpresent, osversion, ostitle, osarchitecture, osserialnumber

Physical Memory:

partnumber

Registry:

computerhardwareid

windowshardwareinfo's People

Contributors

sondernextdoor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

windowshardwareinfo's Issues

when you print the system info ,if it have chinese character,the wcout will be error,the console will never print again

void HardWareInfo::PrintSystem() {
outFile << "System Name:\t\t" << wstringToString(HWID.System.Name) << std::endl;
outFile << "Hypervisor Present:\t\t" << wstringToString(HWID.System.IsHypervisorPresent ? L"Yes" : L"No") << std::endl;
outFile << "OS Title:\t\t\t" << wstringToString(HWID.System.OSName) << std::endl;
outFile << "OS Version:\t\t" << wstringToString(HWID.System.OSVersion) << std::endl;
outFile << "OS Architecture:\t\t" << wstringToString(HWID.System.OSArchitecture) << std::endl;
outFile << "OS Serial Number:\t\t" << wstringToString(HWID.System.OSSerialNumber) << std::endl;
}

MinGW compilation failed

Possible to compile using mingw? I'm getting those three errors during compilation

windows_hardware_info.h:312:83: error: the value of 'DiskExtents' is not usable in a constant expression
  312 |                                 offsetof(VOLUME_DISK_EXTENTS, Extents[DiskExtents.NumberOfDiskExtents]),
      |                                                                                   ^~~~~~~~~~~~~~~~~~~
windows_hardware_info.h:195:33: error: cast from 'BSTR' {aka 'wchar_t*'} to 'unsigned int' loses precision [-fpermissive]
  195 |                 Value.push_back((T) ((bstr_t) Variant.bstrVal).copy());
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: cast from 'BSTR' {aka 'wchar_t*'} to 'int' loses precision [-fpermissive]
  195 |                 Value.push_back((T) ((bstr_t) Variant.bstrVal).copy());
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.