There are 2 registry keys you need to remove.
HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode
HKEY_CLASSES_ROOT\Directory\shell\AnyCode
$ Get-Item "registry::HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode"
Hive: HKEY_CLASSES_ROOT\Directory\Background\shell
Name Property
---- --------
AnyCode (default) : @C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\1033\VSLauncherUI.dll,-1002
Icon : C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe,-105
$ Get-Item "registry::HKEY_CLASSES_ROOT\Directory\shell\AnyCode"
Hive: HKEY_CLASSES_ROOT\Directory\shell
Name Property
---- --------
AnyCode (default) : @C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\1033\VSLauncherUI.dll,-1002
Icon : C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe,-105
$keys = @("Directory\shell", "Directory\Background\shell")
foreach ($key in $keys) {
$reg = [Microsoft.Win32.Registry]::ClassesRoot.OpenSubKey($key, $true)
if ($null -ne $reg) {
$reg.DeleteSubKeyTree("AnyCode", $true)
}
}