Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

disable cmd

Posted on 2008-09-30
3
Medium Priority
?
993 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

610 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