Solved

disable cmd

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

777 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