Some coding. Get CD Key from DigitalProductId



Get CD Key from DigitalProductId

If you lost Windows XP CD Key and want to obtain it from existing Windows installation, this post could be useful for you. The Product Key is stored in registry (in digitalProductId variable) and could be retrieved using special algorithm.

Few years ago, I implemented a function in C++ that reads from registry a digitalProductId, and converts a part of this variable to WindowsXP product key (serial number).

The sourcecode of this function is kept here. The usage is simple, just copy/paste the function in your project and call getWindowsSN() function:

TCHAR buff[30];

if (getWindowsSN(buff))
MessageBox(buff, "Windows S/N", MB_ICONINFORMATION);
else
MessageBox("Error obtaining Windows S/N!", "Error", MB_ICONERROR);

Also, exits another solution in VB which I found somewhere in Internet. To obtain the key, Just save the contents of downloaded file as vbs file and run.

The above solutions are functionable for Windows 2000 and Windows XP.