Windows 命令提示符(Windows Command Prompt)是一个强大的解决方案,管理员可以快速轻松地保持系统正常运行并顺利运行。普通用户很少使用Command Prompt。
许多管理员并没有引诱,而是阻止对命令提示符(Command Prompt)的访问,以阻止用户对计算机错误进行故障排除和四处寻找可能危及系统完整性的地方。
Windows 命令提示符
Windows 命令提示符(Windows Command Prompt)(有时称为DOS提示符)是一种工具,它允许管理员创建批处理功能、解决计算机错误并调用系统范围的命令以使管理更轻松、更高效。普通用户很少使用此工具。
网络(Web)上充斥着关于如何修复基于 Windows 的 PC 上的错误的建议。一些用户自行解决和修复自己的错误,而不是等待专业人士。
一些管理员让自己变得容易,并阻止用户访问命令提示符(Command Prompt),而不是逐个功能地禁止某些功能。阻止对命令提示符(Command Prompt)的访问是一种快速的方法,可以确保用户不会在他们不应该闲逛的地方闲逛。
通过组策略(Group Policy)禁用Windows 命令提示符(Windows Command Prompt)
Note: This method described below will work on Windows Vista, Windows 7, and Windows 8/10, but it will not work for the Home or Starter editions since they do not include support for Group Policy editing. For those cases, you can use the registry method mentioned below.
(Log)使用具有管理权限的帐户登录Windows 。(Windows)单击(Click)开始Start>Run以打开运行(Run)对话框。如果在“开始”菜单上看不到“(Start)运行”(Run)命令,请按住键盘上的Windows键并按R键。在“运行”(Run)框中,输入gpedit.msc并单击“确定(OK)”按钮。
在本地组策略编辑器(Local Group Policy Editor)窗口的左窗格中,打开位于User Configuration>Administrative Templates>System的文件夹。确保单击系统(System)文件夹而不是展开它。
在右侧窗格中,找到并双击标记为“阻止访问命令提示符(Prevent Access to the Command Prompt)”的条目。
您现在应该正在查看“阻止访问命令提示符”(Prevent Access to the Command Prompt)窗口。与大多数Windows安装一样,此设置应设置为未配置(Not Configured)选项。单击已启用(Enabled)选项,然后单击确定(OK)按钮。
关闭所有其他打开的窗口,您就完成了。您无需重新启动计算机即可使设置生效。现在,PC 的所有用户都被拒绝访问命令提示符(Command Prompt)。
禁用通过注册表(Registry)访问(Access)命令提示符(Command Prompt)
如果您无权访问组策略(Group Policy)设置,则可以手动进入注册表并禁用命令提示符。为此,您应该首先确保备份注册表(backup the registry)以防出现问题。
继续并通过单击Start并输入regedit打开注册表编辑器。导航到以下路径:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\
您会在Windows(Windows)键下看到几个键,但可能不是System。如果Windows(Windows)下没有System键,则必须创建它。您可以通过右键单击Windows并选择New – Key来做到这一点。
将键命名为System,选择它,然后在右侧窗格中右键单击并选择New – DWORD (32-bit) Value。
将值命名为DisableCMD并按Enter。然后双击它进行编辑,选择Decimal并为其赋值2。这意味着仅禁用命令提示符。值 0 将启用命令提示符,值 1 将禁用命令提示符并阻止脚本运行。
更改应立即生效。如果您尝试打开命令提示符,它将出现,但带有以下消息:
尽管命令提示符(Command Prompt)是一个有用的管理工具,但很少有Windows 7的普通用户使用它。许多管理员不是逐个功能地拒绝访问操作系统的功能,而是更喜欢使用上述方法之一来阻止对命令提示符的访问。(Command Prompt)享受!
Prevent Access to the Command Prompt in Windows
The Windows Command Prompt is a robust sоlution for administrators to quickly and easіly keep a system up and running smoothlу. It’s rare that the aνerage user has a use for the Command Prompt.
Rather than invite temptation, many administrators prevent access to the Command Prompt to discourage users from troubleshooting computer errors and poking around where they can compromise the integrity of a system.
The Windows Command Prompt
The Windows Command Prompt (sometimes called the DOS prompt) is a tool that allows administrators to create batch functions, troubleshoot computer errors, and invoke system-wide commands to make administration easier and more efficient. The average user has little use for this tool.
The Web is filled with advice on how to fix errors on a Windows-based PC. Some users take it upon themselves to troubleshoot and fix their own errors rather than waiting for a professional.
Some administrators make it easy on themselves and prevent user access to the Command Prompt instead of disallowing certain functions on a function-by-function basis. Preventing access to the Command Prompt is a quick way to ensure that users don’t go poking around in areas they shouldn’t be poking around in.
Disable Windows Command Prompt via Group Policy
Note: This method described below will work on Windows Vista, Windows 7, and Windows 8/10, but it will not work for the Home or Starter editions since they do not include support for Group Policy editing. For those cases, you can use the registry method mentioned below.
Log in to Windows using an account that has administrative privileges. Click on Start>Run to open the Run dialogue box. If you don’t see the Run command on your Start menu, hold down the Windows key on your keyboard and press the R key. In the Run box, type in gpedit.msc and click the OK button.
In the Local Group Policy Editor window’s left pane, open the folder located at User Configuration>Administrative Templates>System. Make sure to click on the System folder rather than expanding it.
In the right hand pane, locate and double click on an entry labeled Prevent Access to the Command Prompt.
You should now be looking at the Prevent Access to the Command Prompt window. Like most installations of Windows , this setting should be set to the Not Configured option. Click on the Enabled option and click the OK button.
Close all other open windows and you are done. You do not have to restart your computer for the setting to take effect. All users of the PC are now denied access to the Command Prompt.
Disable Access to Command Prompt via Registry
If you don’t have access to Group Policy settings, you can manually go into the registry and disable the command prompt. To do this, you should first make sure to backup the registry in case something goes wrong.
Go ahead and open the registry editor by clicking on Start and typing in regedit. Navigate to the following path:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\
You’ll see a couple of keys under the Windows key, but probably not System. If there is no System key under Windows, you have to create it. You can do that by right-clicking on Windows and choosing New – Key.
Name the key System, select it, and then right-click in the right-hand pane and choose New – DWORD (32-bit) Value.
Name the value DisableCMD and press Enter. Then double-click on it to edit it, choose Decimal and give it a value of 2. That means to disable the command prompt only. A value of 0 will enable the command prompt and a value of 1 will disable the command prompt and prevent scripts from running.
The change should take effect immediately. If you try to open the command prompt, it will appear, but with the following message:
Although the Command Prompt is a useful administrative tool, few casual users of Windows 7 have use for it. Rather than deny access to features of the operating system on a function-by-function basis, many administrators prefer to prevent access to the Command Prompt by using one of the methods above. Enjoy!