Search code examples
c#operating-systemsystemprocessor

Get PC (system) information on a Windows machine


Is there a way to get the following information by using C#?

  • PC Name,
  • Service Tag,
  • CPU type,
  • CPU speed,
  • Size of the C:\ drive,
  • Installed RAM,
  • OS name,
  • OS Product Key,
  • Office Version, and Office Product Key.

Solution

  • WMI is what you're looking for.

    http://www.codeproject.com/KB/cs/EverythingInWmi02.aspx

    Let me add the link to Part 3 too, which concentrates on hardware via WMI

    http://www.codeproject.com/KB/cs/EverythingInWmi03.aspx

    MSDN is also a great resource for WMI scopes...

    http://msdn.microsoft.com/en-us/library/aa394554(v=vs.85).aspx