Friday 25 November 2011

Vbscript code to Enable disable the registry of windows

Following is the Vb script code to Enable disable the registry of windows
1 copy the code
2 paste into notepad
3 save the file as Registry.vbs

Enjoy..................

Following is the code

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