Powershell registry error wrong key

Filip 831 Reputation points
2021-04-20T10:28:47.023+00:00

Hello
I tried this command :

(New-Object -ComObject WScript.Shell).RegRead("HKCU:\Control Panel\Colors\")  

And it show me an error.
89516-a.png
What is wrong?

Thanks for help.

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2021-04-20T11:08:01.213+00:00

    Hi @Filip ,

    why are you not using Get-ItemProperty ?
    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-itemproperty?view=powershell-7.1

    $b = "HKCU:\Control Panel\Colors\"  
    Get-ItemProperty -Path $b  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.