If a registry key, exports to a reg file as:


and from a PS window, the following works:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\key

but the following fails:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\key"

How might you reference this key with Reg.exe?

In Notepad++ it appears as CRLF.


  1. Thanks for the comment. It wasn't created by me but I'm trying to read it which then made me pretty curious. I see you can create a key with PS, using the ISE as an example where the value of the name is split over 2 lines:

    new-item -Path "HKLM:\SOFTWARE\a\" -name "test
  • if the key really contains a new line then just Get-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\key`n" is enough. But how did you create that key? New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\key`n" doesn't work
    – phuclv
    Apr 15, 2021 at 15:39
  • technically that name is invalid because only printable characters except backslash \ are allowed in keynames and new line is not a printable character What are the valid characters for Registry keys and valuenames?. So it's probably a bug in the registry which doesn't validate names correctly
    – phuclv
    Apr 16, 2021 at 14:48


You must log in to answer this question.

Browse other questions tagged .