31 March 2011

Blocking CMD (Command Prompt)

The first question that comes to your mind might be : "Why would someone block the Command Prompt?"
There are some reasons to do this and one of the reasons is to prevent unwanted users from messing with your policies and having elevated privileges.

This trick is used by Internet Cafe Admins and IT Managers in many companies.

How to :

There are two simplest methods that can be used for this purpose. 

First Method :
  • Open notepad.exe
  • Type in the code below:
      dim reg
   set reg = CreateObject("Wscript.Shell")
   reg.RegWrite "HKCU\Software\Policies\Microsoft\Windows\System\DisableCMD", "1", "REG_DWORD"

  • Save it as DisableCMD.vbs
  • Run it by double-clicking on the file.
 Second Method :
  • Open cmd.exe
  • type in : reg add HKCU\Software\Policies\Microsoft\Windows\System /v DisableCMD /d 1 /t REG_DWORD
  • Press enter and close the CMD window. 

Now, having disabled the CMD, what if you wanted to re-enable it for some reason, such as when it is disabled by a virus?

We only have one option left (since I taught you only two methods and the second won't work because the CMD itself is blocked already), wchich is to use VBScript.

The steps would be :
  • Open notepad.exe 
  • Type in the code below:
      dim reg
   set reg = CreateObject("Wscript.Shell")
   reg.RegWrite "HKCU\Software\Policies\Microsoft\Windows\System\DisableCMD", "0", "REG_DWORD"

  • Save as EnableCMD.vbs
  • Double-click on the icon to run the script

Actually there are more methods in doing this(writing to the registry), such as :
-Using BAT Files
-Using CMD Files
-Using REG Files
-Directly editing the values from regedit.exe(Windows Registry Editor)
-etc.




Finally, thank you for reading this post. May this be useful.


Cyber Frost

No comments:

Post a Comment

Search