Get pc (system) information on windows machine

dps123 picture dps123 · Jan 20, 2011 · Viewed 71.8k times · Source

Is there a way to get the following information by using c# script.

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.

Thanks.

Answer

dotalchemy picture dotalchemy · Jan 20, 2011

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