Click to See Complete Forum and Search --> : Windows Product ID


Joe Nellis
October 18th, 2004, 12:30 AM
Does anyone know how to get the windows ProductID? You can see your product id by hitting the windowskey and the pause/break key together. Supposedly this is generated based on your hardware configuration and O/S version. I would like to use this number as an identifier for a unique machine (or close enough).

bigBA
October 18th, 2004, 01:10 AM
open the registry editor and search for your product id (i found a key which holds it - but i don't know if it exists for all systems)

Joe Nellis
October 18th, 2004, 09:52 AM
Yes but the registry holds this value in a number of places and I don't know if this is consistent between O/S versions.

I was looking for a win api call for this.

AdaraCD
October 18th, 2004, 10:45 AM
On a computer running Windows 9X,
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/ProductID
-OR-
On a computer running Windows NT,
HKEY_LOCAL_MACHINE/Software/Microsoft/WindowsNT/CurrentVersion/ProductID

Sam Hobbs
February 26th, 2006, 12:48 AM
Are you still looking for this? I am nearly certain that there is an API solution (at least one); I think WMI is one, but I won't bother to look if you don't need it.

logan
February 26th, 2006, 09:59 AM
Sam, please have a look for such an API. It will be useful for all.

Regards.

kirants
February 26th, 2006, 12:17 PM
WMI class info can be found here. I think you are looking for SerialNumber class member.
Win32_OperatingSystem (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_operatingsystem.asp)

Note that this is available only on NT based platforms.
I believe what AdaraCD has posted should do the job

Sam Hobbs
February 26th, 2006, 02:07 PM
Also see Sesame Script: Class is in Session (http://www.microsoft.com/technet/scriptcenter/resources/begin/ss0905.mspx); it mentions the Win32_OperatingSystem (http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_operatingsystem.asp?frame=true) class and the SerialNumber property. When someone is familiar with WMI it is often easy to find answers that use WMI.