Announcement

Collapse
No announcement yet.

Registry Key Syntax

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Registry Key Syntax

    Using the following as an example:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\AutoRotation]
    "Enable"=dword:00000000

    I created the following as "On Post Install"

    Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRot ation", "Enable", "00000000", REG_DWORD);

    If I merge the registry key listed first, it works, the "On Post Install" did not set the key

    Please advise

  • #2
    Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Aut oRot ation", "Enable", "00000000", REG_DWORD);

    The post added a space that is not there in AutoRotation

    Comment


    • #3
      Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRot ation", "Enable", "00000000", REG_DWORD);

      Comment


      • #4
        That line of code probably should be written as this.

        Code:
        Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AutoRotation", "Enable", "00000000", REG_DWORD);
        Backslashes in strings need to be escaped.

        Ulrich

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎