Skip to content

keyExists does not throw error when Registry editing has been disabled by your administrator. #56

@xmedeko

Description

@xmedeko

Current behaviour

When registry editing is prohibited, then keyExists return false.

Expected behaviour

keyExists should throw same ProcessUncleanExitError like other functions:

C: ADD command exited with code 1:

ERROR: Registry editing has been disabled by your administrator.

Proposed solution

keyExists should check for error message "The system was unable to find the specified registry key or value." too. Since reg.exe fails with error code 1 for various reasons. Note: seems to me, that reg.exe does not localize messages (while regedit.exe does localize).

How to simulate

See https://www.online-tech-tips.com/windows-xp/registry-disabled-by-administrator/ :

  1. Run gpedit.msc,
  2. Navigate to User Configuration – Administrative Templates – System,
  3. Change Prevent access to registry editing tools.
  4. Optional: run gpupdate.exe from command line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions