Disable Registry Editor Using VB Script

Logo
As you know that Registry Editor is a gate that can change the all your Windows registry value. It means if somebody want to destroy your Windows XP just open Registry Editor and change the important. So I want to share the trick to disable or enable Registry Editor with one click…

There are so many tricks to enable / disable Registry Editor but I think this trick is easy enough to do that although we need to writing a script to first time but after your script has done then it’s be easier, we will use the Visual Basic Script language here.

OK, follow this trick:
1. Open Notepad (or your favorite text editor) to type the script via Start – Run menu and type notepad in textbox then click OK button or press Enter
key.
Open notepad

2. And type the script like this:

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

You can copy and paste to your notepad.
Type script

3. Save it, click File – Save As.
Save As

4. Change Save As Type to All Files and give it the name regedit.vbs (or whatever you want but the extension has to vbs).
Save As Type

5. Then make sure that you have the right file name format, you can see it on Notepad title bar.
Make sure

6. Open your folder that containing regedit.vbs file.
Open vbs folder

7. Double click that file and Edit Regedit window will opened.
Edit Regedit window

8. If you fill the textbox with value 0, Registry Editor will enable to open.
Message box

9. But if you fill it with value 1,
Typing value to 1

Registry Editor will disable to open.
Message box

10. Now, try to open your Registry Editor and you will get a notification that Registry Editor is disabled.
Message box

3 Comments

bibo  on October 5th, 2008

thanks edi this is great! can i modify this script not only for enabling the registry tools, but for disabling usb storage and for showall files, enabling folder options, enabling taskmanager. this script is the best!!! more power and thanks!!!!!! alot!!

Edi Kwie  on October 7th, 2008

Yes, you may modify it as you need. You just need to modify the registry path and its value and then this script has new function… and I am glad this article could give a little bit help…

Hide Run Menu With Visual Basic Script | Otak Atik [dot] Com  on November 27th, 2008

[...] written an article about Manage Registry with Visual Basic Script and this time I want to modified the script to make it to manage Run menu. As you know Run menu is [...]

Leave a Comment