Solved

disable cmd

Posted on 2008-09-30
3
989 Views
Last Modified: 2012-05-05
vbs or other possible code to disable and enable command prompt in xp and vista
0
Comment
Question by:ankur3020
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Assisted Solution

by:Anthony2000
Anthony2000 earned 50 total points
ID: 22607723
Try this for XP, I am not sure if it will work for Vista:

http://www.pctools.com/guides/registry/detail/1143/
0
 

Accepted Solution

by:
ankur3020 earned 0 total points
ID: 22694735
thanks ,
0
 
LVL 8

Expert Comment

by:Anthony2000
ID: 22697803
I re-read your request and realized that you wanted some code snippets. See attached.

' I put the following in a file called DisabledCmdPrompt.vbs
' Disable CMD Prompt
Option Explicit
Dim objShell, strRoot, strModify, strDelete
strRoot = "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD"
Set objShell = CreateObject("WScript.Shell")
strModify = objShell.RegWrite(strRoot,"00000001", "REG_DWORD")
if err.number <> 0 then
WScript.Echo "Error No: " & err.number & " check " & strRoot
else
wscript.Echo "Command Prompt Disabled"
end if
strModify = null
WScript.Quit
 
'''''''''''''''''''''''''''''''''''''''''''''
 
 
' I put the following in a file called EnableCmdPrompt.vbs
'Enable CMD Prompt
Option Explicit
Dim objShell, strRoot, strModify, strDelete
strRoot = "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD"
Set objShell = CreateObject("WScript.Shell")
strModify = objShell.RegWrite(strRoot,"00000000", "REG_DWORD")
if err.number <> 0 then
WScript.Echo "Error No: " & err.number & " check " & strRoot
else
wscript.Echo "Command Prompt Enabled"
end if
strModify = null
WScript.Quit

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question