How to find Visual Studio License key from the RegEdit?

minh tran 216 Reputation points
2022-03-25T14:25:33.723+00:00

Hello,
I am new , and I would like to find the Visual Studio production key from regedit.

I am able to get this far as below

186956-capture.png

But I don't know where the production key is located in which directory? Could you help on where I can find the production key from which directory?

Thanks,
MInh

Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2022-03-25T14:47:33.78+00:00

    Why do you think it is in the registry? VS has moved away from the registry for the most part because you can have multiple instances of VS installed at the same time and each instance is licensed separately. For example I have VS Pro (1 license) and VS Pro Preview (another license) and VS Community (yet another license). The registry key you pointed to only applies to things that are shared across all instances and that is becoming less and less.

    At least for VS 2019 and VS 2022 for a MSDN subscription then the licensing is stored (at least) in the per-instance registry key under HKCU\Software\Microsoft\VisualStudio\##.#_???\Licenses. Unfortunately there is no easy way to match the instance name to a specific install as it is a randomly generated number. The preferred approach to getting info about installed VS instances is to use vswhere which is the CLI that MS built to provide information about installed instances including their instance number and path. However vswhere returns product information and licensing is per user so it won't tell you anything user specific as far as I'm aware. You'll ultimately have to enumerate the VS instances installed for the current user and try to find the encoded product key.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.