Solved

disable cmd

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

911 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

22 Experts available now in Live!

Get 1:1 Help Now