hihoo82

Enable Registry Editor

Jul 12th, 2017
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. Option Explicit
  2.     Dim WSHShell, n, MyBox, p, t, mustboot, errnum, vers
  3.     Dim enab, disab, jobfunc, itemtype
  4.     Set WSHShell = WScript.CreateObject("WScript.Shell")
  5.     p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\"
  6.    p = p & "DisableRegistryTools"
  7.    itemtype = "REG_DWORD"
  8.    mustboot = "Log off and back on, or restart your pc to" & vbCR & "effect the changes"
  9.    enab = "ENABLED"
  10.    disab = "DISABLED"
  11.    jobfunc = "Registry Editing Tools are now "
  12.    t = "Confirmation"
  13.    Err.Clear
  14.    On Error Resume Next
  15.    n = WSHShell.RegRead (p)
  16.    On Error Goto 0
  17.    errnum = Err.Number
  18.    if errnum <> 0 then
  19.    WSHShell.RegWrite p, 0, itemtype
  20.    End If
  21.    If n = 0 Then
  22.    n = 1
  23.    WSHShell.RegWrite p, n, itemtype
  24.    Mybox = MsgBox(jobfunc & disab & vbCR & mustboot, 4096, t)
  25.    ElseIf n = 1 then
  26.    n = 0
  27.    WSHShell.RegWrite p, n, itemtype
  28.    Mybox = MsgBox(jobfunc & enab & vbCR & mustboot, 4096, t)
  29.    End If
Add Comment
Please, Sign In to add comment