Solved

disable cmd

Posted on 2008-09-30
3
975 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now