笔记本禁用键盘命令符
The Command Prompt and the Run program are pretty powerful tools in the Windows world. If you’d rather specific users on a computer not have access to them, it’s not too hard to do.
命令提示符和运行程序是Windows世界中非常强大的工具。 如果您希望计算机上的特定用户没有访问权限,那么这样做就不太困难了。
Windows makes it pretty easy to open the Command Prompt, and there are all kinds of useful things you can do with it. It can also be a dangerous tool in the hands of the inexperienced, as it exposes a lot of power and it’s sometimes difficult to understand the full ramifications of a command. The Run program is similarly dangerous, as you can use it to perform many of the same commands you would at the Command Prompt. There are all kinds of reasons you might want to disable these features for certain users on a computer. Maybe you’ve got kids who share a family computer or you let guests use your computer when they stay with you. Or perhaps you’re running a business computer as a kiosk for customers and you need to lock it down. Whatever your reason, we’ve got the fix for you.
Windows使打开命令提示符变得非常容易,并且您可以使用它进行各种有用的操作。 对于经验不足的人来说,它也可能是一个危险的工具,因为它暴露了很多功能,有时很难理解命令的全部后果。 运行程序同样危险,因为您可以使用它执行许多与命令提示符相同的命令。 出于各种原因,您可能想为计算机上的某些用户禁用这些功能。 也许您有共享一台家庭计算机的孩子,或者让客人在和您在一起时使用您的计算机。 或者,也许您正在将商务计算机作为供客户使用的信息亭,则需要将其锁定。 无论您是什么原因,我们都会为您提供解决方案。
家庭用户:通过编辑注册表来禁用命令提示符并运行程序 (Home Users: Disable the Command Prompt and Run Program by Editing the Registry)
If you have a Home edition of Windows, you will have to edit the Windows Registry to make these changes. You can also do it this way if you have Windows Pro or Enterprise, but just feel more comfortable working in the Registry. (If you have Pro or Enterprise, though, we recommend using the easier Local Group Policy Editor, as described in the next section.) Keep in mind, though, that when editing the Registry, you’ll need to be logged on as the user for which you want to disable shutdown.
如果您有Windows的家庭版,则必须编辑Windows注册表才能进行这些更改。 如果您拥有Windows Pro或Enterprise,也可以通过这种方式进行操作,但是在注册表中工作会更自在。 (但是,如果您具有Pro或Enterprise,我们建议使用更简单的“本地组策略编辑器”,如下一节所述。)但是请记住,在编辑注册表时,您需要以您要禁用关机的用户。
Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.
标准警告:注册表编辑器是一个功能强大的工具,滥用它会使您的系统不稳定甚至无法运行。 这是一个非常简单的技巧,只要您按照说明进行操作,就不会有任何问题。 也就是说,如果您以前从未使用过它,请在开始之前考虑阅读有关如何使用注册表编辑器的信息。 并在进行更改之前一定要备份注册表(和您的计算机!)。
To get started, log in as the user for whom you want to make these changes. Open the Registry Editor by hitting Start and typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC. First, you’re going to disable the Command Prompt. In the Registry Editor, use the left sidebar to navigate to the following key:
首先,以您要对其进行更改的用户身份登录。 通过单击开始并键入“ regedit”来打开注册表编辑器。 按Enter键打开注册表编辑器,并授予其对PC进行更改的权限。 首先,您将禁用命令提示符。 在注册表编辑器中,使用左侧边栏导航至以下键:
HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\System
Next, you’re going to create a new value in that key. Right-click the System icon and choose New > DWORD (32-bit) Value. Name the new value DisableCMD
.
接下来,您将在该键中创建一个新值。 右键单击“系统”图标,然后选择“新建”>“ DWORD(32位)值”。 将新值命名为DisableCMD
。
Now, you’re going to modify that value. Double-click the new DisableCMD
value and set the value to 1
in the “Value data” box and click OK.
现在,您将修改该值。 双击新的DisableCMD
值,然后在“值数据”框中将其值设置为1
,然后单击“确定”。
Now that the Command Prompt itself is disabled, your next step is to disable the Run program. In Registry Editor, navigate to the following key:
现在,命令提示符本身已被禁用,下一步是禁用运行程序。 在注册表编辑器中,导航到以下项:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
Right-click the Explorer icon and choose New > DWORD (32-bit) Value. Name the new value NoRun
.
右键单击“资源管理器”图标,然后选择“新建”>“ DWORD(32位)值”。 将新值NoRun
。
Double-click the new NoRun
value and set the “Value data” box to 1
.
双击新的NoRun
值,并将“值数据”框设置为1
。
Click OK, exit Registry Editor, restart your computer, and log in as the user for whom you made the change. That user should no longer have access to the Run program or the Command Prompt. If they try to access the Run command while it’s disabled they will see the following error message.
单击“确定”,退出注册表编辑器,重新启动计算机,然后以进行更改的用户身份登录。 该用户将不再有权访问运行程序或命令提示符。 如果他们在禁用运行命令的情况下尝试访问运行命令,则会看到以下错误消息。
If you want to re-enable the Command Prompt or Run program, just log back in as that user, open up the Registry, and set either value back to 0.
如果要重新启用命令提示符或运行程序,只需以该用户身份重新登录,打开注册表,然后将其中一个值都设置为0。
下载我们的一键式注册表黑客 (Download Our One-Click Registry Hacks)
If you don’t feel like diving into the Registry yourself, we’ve created some downloadable registry hacks you can use. There are hacks to disable and re-enable both the Command Prompt and Run program. All four hacks are included in the following ZIP file. Double-click the one you want to use and click through the prompts. When you’ve applied the hacks you want, restart your computer
如果您不想自己进入注册表,我们已经创建了一些可下载的注册表黑客,供您使用。 有一些技巧可以禁用和重新启用命令提示符和运行程序。 以下ZIP文件中包含所有四个hack。 双击您要使用的一个,然后单击提示。 应用所需的技巧后,请重新启动计算机
Command Prompt and Run Hacks
命令提示符和运行技巧
These hacks are really just the applicable keys, stripped down to the values we talked about in the previous section and then exported to a .REG file. Running either of the enable hacks changes the that particular value to 1. Running either of the enable hacks sets that particular value back to 0. And if you enjoy fiddling with the Registry, it’s worth taking the time to learn how to make your own Registry hacks.
这些hack实际上只是适用的密钥,被精简为上一节中讨论的值,然后导出到.REG文件。 运行任何一个使能hack都会将该值更改为1。运行这两个使能hack都会将该值恢复为0。如果您喜欢注册表,那么花点时间学习如何制作自己的注册表是值得的骇客。
专业版和企业版用户:使用本地组策略编辑器禁用命令提示符并运行程序 (Pro and Enterprise Users: Disable the Command Prompt and Run Program with Local Group Policy Editor)
If you’re using Windows Pro or Enterprise, the easiest way to disable the Command Prompt and Run program is by using the Local Group Policy Editor. It’s a pretty powerful tool, so if you’ve never used it before, it’s worth taking some time to learn what it can do. Also, if you’re on a company network, do everyone a favor and check with your admin first. If your work computer is part of a domain, it’s also likely that it’s part of a domain group policy that will supersede the local group policy, anyway. Also, since you’ll be creating policy tweaks for specific users, you’ll need to take the extra step of creating a policy console geared toward those users.
如果您使用的是Windows Pro或Enterprise,则禁用命令提示符和运行程序的最简单方法是使用本地组策略编辑器。 这是一个非常强大的工具,因此,如果您以前从未使用过它,那么值得花一些时间来学习它可以做什么。 另外,如果您在公司网络中,请给所有人一个帮助,并首先与您的管理员联系。 如果您的工作计算机是域的一部分,则它也很可能是域组策略的一部分,无论如何,该组策略将取代本地组策略。 另外,由于您将为特定用户创建策略调整,因此您需要采取额外的步骤来创建针对这些用户的策略控制台。
In Windows Pro or Enterprise, find the MSC file that you made for the users to whom you want to apply the policy, double-click to open it, and click Yes to allow it to make changes. In the Group Policy window for those users, in the left-hand pane, drill down to User Configuration > Administrative Templates > System. On the right, find the “Prevent access to the command prompt” item and double-click it.
在Windows Pro或Enterprise中,找到为要应用该策略的用户制作的MSC文件,双击以将其打开,然后单击“是”以允许其进行更改。 在这些用户的“组策略”窗口的左侧窗格中,向下钻取到“用户配置”>“管理模板”>“系统”。 在右侧,找到“防止访问命令提示符”项,然后双击它。
Set the policy to Enabled and then click OK. Note also that there is a drop-down menu that lets you also disable Command Prompt scripting. This removes the ability for the user to run scripts and batch files. If you’re really trying to lock down the command line ability from a savvy user, go ahead and turn this setting on. If you’re just trying to remove easy access from the Command Prompt (or if you need Windows to still be able to run logoff, logon, or other batch files), leave the setting off.
将策略设置为“已启用”,然后单击“确定”。 还要注意,有一个下拉菜单,您还可以禁用命令提示符脚本。 这使用户无法运行脚本和批处理文件。 如果您真的想锁定精明的用户的命令行功能,请继续并启用此设置。 如果您只是想从命令提示符中删除方便的访问权限(或者如果您需要Windows仍然能够运行注销,登录或其他批处理文件),请取消设置。
Next, you’re going to disable the ability to access the Run program. Back in the Group Policy window for those users, find User Configuration > Administrative Templates > Start Menu and Taskbar. On the right, find the “Remove Run from Start Menu” item and double-click it.
接下来,您将禁用访问“运行”程序的功能。 返回这些用户的“组策略”窗口中,找到“用户配置”>“管理模板”>“开始”菜单和任务栏。 在右侧,找到“从开始菜单中删除运行”项,然后双击它。
Set the policy to Enabled and then click OK.
将策略设置为“已启用”,然后单击“确定”。
You can now exit the Group Policy Editor. If you want to test the new settings, log off and then log back on as the user (or a member of the user group) for which you made changes. If you want to re-enable the Command Prompt or Run program, just use the editor to set the items back Not Configured (or Disabled).
现在,您可以退出组策略编辑器。 如果要测试新设置,请注销,然后以对其进行更改的用户(或用户组成员)的身份重新登录。 如果要重新启用命令提示符或运行程序,只需使用编辑器将项目设置回“未配置”(或“禁用”)即可。
And that’s it. It takes a little doing, but it’s not too hard to lock down some of these more powerful tools from users.
就是这样。 这需要花点功夫,但是锁定用户中一些更强大的工具并不难。
翻译自: https://www.howtogeek.com/249007/how-to-disable-the-command-prompt-and-run-program-in-windows/
笔记本禁用键盘命令符