Wednesday, 14 December 2011

REG ENABLE DISABLE

copy the code in notpad and save it with extension .vbs like this (enable reg.vbs)

Dim otakatik
ManageRegedit()
Sub ManageRegedit()
Set otakatik=WScript.CreateObject("wscript.shell")
describe="Type 0 or 1 : " & VbCrLf &_
             "[0] -> Enable Regedit." & VbCrLf &_
             "[1] -> Disable Regedit."
question=InputBox(describe, "Edit Regedit",0)
otakatik.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion" &_
                        "\Policies\System\DisableRegistryTools",question,"REG_DWORD"
If question=1 Then
   MsgBox "Registry is disabled.",VbInformation, "Disabled"
Else
   If question=0 Then
      Msgbox "Registry is enabled.",VbInformation, "Enabled"
      otakatik.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion" &_
                                "\Policies\System\DisableRegistryTools"
   Else
      Msgbox "Input 0 or 1 only !",VbInformation, "Wrong Input"
      ManageRegedit()
   End If
End If
End Sub

No comments:

Post a Comment