I found the answer in this blog post:
See how empty is the regular HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio15.0 key on my machine and notice that there is no 15.0_Config key:
Instead, the VS 2017 private registry is stored in your AppData folder:
Fortunately, you can use regedit.exe to load a private hive. You need to select the HKEY_USERS node, and click the File > Load Hive… menu. You select the privateregistry.bin file, give a name to the hive (I entered “VS2017PrivateRegistry”) and now you can see the 15.0_Config key populated as usual (note: use File > Unload Hive when done):
Using this guide, I was able to load the private registry, do the changes from the SO answer mentioned earlier, unload the hive and start VS 2017 with the Dark Theme!
EDIT: I had to slightly modify the PowerShell script I used to edit the registry, here is the updated version if anyone is interested:
EDIT2: Now modified to include the loading of the private registry automatically as well, including a garbace collection to allow unloading the hive:
NOTE: You have to find your own correct path for the user name (C:UsersGeir
) and VS version (15.0_8165452c
).
New-PSDrive HKU Registry HKEY_USERS
reg load 'HKUVS2017PrivateRegistry' "C:UsersGeirAppDataLocalMicrosoftVisualStudio15.0_8165452cprivateregistry.bin"
$HighConstrastTheme = "HKU:VS2017PrivateRegistrySoftwareMicrosoftVisualStudio15.0_8165452c_ConfigThemes{a5c004b4-2d4b-494e-bf01-45fc492522c7}"
$DarkTheme = "HKU:VS2017PrivateRegistrySoftwareMicrosoftVisualStudio15.0_8165452c_ConfigThemes{1ded0138-47ce-435e-84ef-9ec1f439b749}"
Remove-Item -Path $HighConstrastTheme -Recurse
Copy-Item -Path $DarkTheme -Destination $HighConstrastTheme -Recurse
[gc]::collect()
reg unload 'HKUVS2017PrivateRegistry'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…