Do you really need to find out the Product Code of your SQL Server installation? You can use windows registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup
And look for key value ProductCode
Alternatively, you can use the undocumented stored procedure xp_regread, as follows:
EXEC xp_regread 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup','ProductCode'
Please note that all this is undocumented and unsupported so be careful when you browse the registry or use undocumented SPs. Play with your test installations only.
The registry path also depends on which version of SQL Server is installed and is it a fresh installation or an upgrade.
Hope you enjoyed reading this.