Accessing the registry from TSQL on SQL Server 2012 and 2008R2
With SQL Server versions 2008R2 and 2012, you can access the registry to get the settings for the current instance of SQL Server. Here is how it works using the dynamic management view (DMV) called dm_server_registry. From there you get get at all sorts of information about the current SQL Server instance. Give dm_server_registry a try.