Looking for a unique GUID to identify a Windows installation

Im looking for a unique GUID stored in the Windows registry that would help me identify a Windows installation or PC.

The GUID must;

  • Always exist
  • Be unique to a particular Windows installation, i.e. no other computer would have the same ID
  • Never change

Many thanks


You can get GUID from windows registry, for example:

var regpath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\MachineGuid";
var oWSS = new ActiveXObject("WScript.Shell");
clientGUID = oWSS.RegRead(regpath);

Do you expect this number to change or stay the same if the drive for that install is moved to another system?

Do you expect this number to be changed if the install is cloned with ghost or something else? Can you depend on cloned systems always being sysprep'd following Microsoft's recommendations? The SID should be fine, if you can be sure your installs are never cloned.

In the case of a multi-boot system (i.e. system has Windows 7 and a Windows XP install) do you need to identify the two installs as unique, or related or what?

Why do you need this to be part of the windows installation, and not something presented by the hardware, perhaps the processor serial number?

I am assuming you are asking about this for some kind of script or tool you are using for inventory purposes?

Why don't you simply generate your own number the first time you run the tool and save it in the LOCAL_MACHINE registry hive? Perhaps even use an RFC4122 Type 1 number and which should include the hardware address for one of the network interfaces. That way you can check to see if the UUID still belongs to that system by comparing the UUID against the present network adapters.


You want to use the Windows Product ID. This is a unique number generated (hashed) partially from the product key installed, and partially from the hardware configuration, including processor serial number and MAC address from the first NIC. You can read about it on this (somewhat dated, but still valid) TechNet article. The product ID can be found on the System Information screen, or programatically through several methods.

System Information