Disconnect
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /t Reg_dword /v DisableRegistryTools /f /d 1
After executing the command, when you try to start the editor, the following message will be displayed:
Enable
Allowing it to run in the same way, via reg add , will not work, since the console version of the editor will also display a message stating that editing the registry is prohibited by the administrator. You can enable launch via the .inf installation file.
1 2 3 4 5 6 7 8 |
[Version] Signature="$Chicago$" [DefaultInstall] AddReg=UnhookRegKey [UnhookRegKey] HKCU, Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,0x00000020,0 |
You need to run the file through the context menu by selecting the "Install" item.
Universal option
The next option uses one vbs file, which: if the registry editor is enabled, it will disable it, and if disabled, it will enable it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
Option Explicit Dim WSHShell, n, MyBox, p, t, errnum, vers Dim enab, disab, jobfunc, itemtype Set WSHShell = WScript.CreateObject("WScript.Shell") p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\" p = p & "DisableRegistryTools" itemtype = "REG_DWORD" enab = "enabled." disab = "disabled." jobfunc = "Registry Editor" t = "Confirmation" Err.Clear On Error Resume Next n = WSHShell.RegRead (p) On Error Goto 0 errnum = Err.Number if errnum <> 0 then 'Create the registry key value for DisableRegistryTools with value 0 WSHShell.RegWrite p, 0, itemtype End If If n = 0 Then n = 1 WSHShell.RegWrite p, n, itemtype Mybox = MsgBox(jobfunc & disab, 4096, t) ElseIf n = 1 then n = 0 WSHShell.RegWrite p, n, itemtype Mybox = MsgBox(jobfunc & enab, 4096, t) |