0

There is a key

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant

which contains Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant in its path. I have to set 0 value

New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant -Name Enabled -Value 0 -Force

But the only way to set a value due backspace is

[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $COMPUTERNAME).OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience/Steps-Recorder", $true).SetValue("Enabled", 0)

Is there any solution to avoid .NET Framework?

farag
  • 325
  • 1
  • 4
  • 20
  • 1
    What do you mean "set a value due backspace"? – Jeff Zeitlin Aug 16 '17 at 13:26
  • @JeffZeitlin Pretty sure that they meant forward slash. `Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant` – BenH Aug 16 '17 at 13:46
  • 1
    Possible duplicate of [How to create a registry entry with a forward slash in the name](https://stackoverflow.com/questions/18218835/how-to-create-a-registry-entry-with-a-forward-slash-in-the-name) – BenH Aug 16 '17 at 13:48
  • Adi Inbar's answer has the way to add the character. Alternately you can get the item with getting the parent key, then using where object to filter the name then piping that to `set-itemproperty`. `gci 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\' | Where-Object {.name -like '*Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant'} | Set-ItemProperty -Name Enabled -Value 0 -Force` – BenH Aug 16 '17 at 13:49
  • I doesnt't work. Console doesn't display any error, but the value does not change. – farag Aug 16 '17 at 16:20

1 Answers1

0
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience\Program-Compatibility-Assistant -Name Enabled -Value 0 -Force

windows doesn't have much difference in '/' & '\' , few things may break here and there but you can open c:\windows and c:/Windows equally.

So try using the \ .

Ranadip Dutta
  • 8,857
  • 3
  • 29
  • 45
VGSandz
  • 144
  • 5