{"id":4631,"date":"2015-02-02T08:01:44","date_gmt":"2015-02-02T08:01:44","guid":{"rendered":"http:\/\/www.top-password.com\/blog\/?p=4631"},"modified":"2023-06-09T02:23:15","modified_gmt":"2023-06-09T02:23:15","slug":"disable-command-prompt-using-group-policy-or-registry-trick","status":"publish","type":"post","link":"https:\/\/www.top-password.com\/blog\/disable-command-prompt-using-group-policy-or-registry-trick\/","title":{"rendered":"Disable Command Prompt Using Group Policy or Registry Trick"},"content":{"rendered":"<p>Command Prompt is a built-in tool in Windows that is rarely used by the average user. It&#8217;s not so user-friendly but advanced computer users with malicious intent can use the Command Prompt to bypass most restrictions that are enforced on the Windows Explorer based GUI. In this post, we will explain how to disable Command Prompt in Windows 11\/10\/8\/7.<\/p>\n<p><strong>Note:<\/strong> <em>If you need to use the Command Prompt frequently, or run batch scripts or use the Terminal Services, disabling Command Prompt is not recommended.<\/em><\/p>\n<p><strong>Option 1: Disable Command Prompt Using Group Policy<\/strong><\/p>\n<ol>\n<li>Press the Windows key + R to bring up the Run box, type <strong>gpedit.msc<\/strong> and hit Enter.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2016\/04\/gpedit.png\" alt=\"\" width=\"399\" height=\"206\" class=\"alignnone size-full wp-image-6676\" \/>\n<\/li>\n<li>This will open the Local Group Policy Editor. Now, go to the following location in the left pane:<br \/>\n<code>User Configuration\/Administrative Templates\/System<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/prevent-access-to-the-command-prompt.png\" alt=\"\" width=\"556\" height=\"346\" class=\"alignnone size-full wp-image-19958\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/prevent-access-to-the-command-prompt.png 556w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/prevent-access-to-the-command-prompt-300x187.png 300w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p>\tMake sure click on the <strong>System<\/strong> node rather than expanding it. In the right side pane you will see the &#8220;<strong>Prevent access to the command prompt<\/strong>&#8221; policy. Double-click it to modify.\n<\/li>\n<li>In the pop-up window, select <strong>Enabled<\/strong>. If you also want to prevent running .bat or .cmd script files, select <strong>Yes<\/strong> from the dropdown under the <strong>Options<\/strong> section. Click Apply\/OK and you are done.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/disable-command-prompt-gpo.png\" alt=\"\" width=\"600\" height=\"492\" class=\"alignnone size-full wp-image-19959\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/disable-command-prompt-gpo.png 600w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/disable-command-prompt-gpo-300x246.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<\/li>\n<li>You do not have to restart your computer for the setting to take effect. If you try to launch the Command Prompt, you&#8217;ll see the message &#8220;<strong>The command prompt has been disabled by your administrator.<\/strong>&#8221;\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/command-prompt-disabled-1.png\" alt=\"\" width=\"550\" height=\"170\" class=\"alignnone size-full wp-image-19960\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/command-prompt-disabled-1.png 550w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/command-prompt-disabled-1-300x93.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<\/li>\n<\/ol>\n<p><strong>Option 2: Disable Command Prompt with Registry Trick<\/strong><\/p>\n<p>Unfortunately, the Local Group Policy (gpedit.msc) is not available in all editions of Windows. For those users running the Home edition of Windows, you can still disable Command Prompt with this registry tweak:<\/p>\n<ol>\n<li>Press the Windows key + R to bring up the Run box, type <strong>regedit<\/strong> and hit Enter.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2021\/11\/regedit.png\" alt=\"\" width=\"399\" height=\"206\" class=\"alignnone size-full wp-image-17356\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2021\/11\/regedit.png 399w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2021\/11\/regedit-300x155.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/>\n<\/li>\n<li>This will open the Registry Editor. Navigate to the registry key: <code>HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Windows<\/code>. Right-click the <strong>Windows<\/strong> key in the left sidebar and choose <strong>New<\/strong> -> <strong>Key<\/strong>.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/new-key.png\" alt=\"\" width=\"572\" height=\"373\" class=\"alignnone size-full wp-image-19961\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/new-key.png 572w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/new-key-300x196.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/>\n<\/li>\n<li>Name the newly-created as <strong>System<\/strong>. When the System key is selected, right-click the blank area in the right pane and select <strong>New<\/strong> -> <strong>DWORD (32-bit) Value<\/strong>.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/new-dword.png\" alt=\"\" width=\"563\" height=\"294\" class=\"alignnone size-full wp-image-19962\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/new-dword.png 563w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/new-dword-300x157.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/>\n<\/li>\n<li>Name the DWORD as <strong>DisableCMD<\/strong> and then give it a value 1 for disabling the Command Prompt and preventing batch files from running. If you want to disable the Command Prompt but allow batch files, set the value to 2. This change will take effect immediately.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/DisableCMD-registry.png\" alt=\"\" width=\"563\" height=\"342\" class=\"alignnone size-full wp-image-19970\" srcset=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/DisableCMD-registry.png 563w, https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2015\/02\/DisableCMD-registry-300x182.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/p>\n<p>To enable the Command Prompt again, just change the value to 0.\n<\/li>\n<\/ol>\n<p><strong>Conclusion<\/strong><\/p>\n<p>So this is how you can disable the Command Prompt in all versions of Windows. If you need a more secure method to lock the Command Prompt, you can use the third-party software &#8211; <a href=\"http:\/\/www.top-password.com\/protect-my-folders.html\" style=\"text-decoration:underline;\">Protect My Folders<\/a>, which allows you to protect <em>c:\\windows\\system32\\cmd.exe<\/em> with a password.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Command Prompt is a built-in tool in Windows that is rarely used by the average user. It&#8217;s not so user-friendly but advanced computer users with malicious intent can use the Command Prompt to bypass most restrictions that are enforced on the Windows Explorer based GUI. In this post, we will explain how to disable Command [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,10,1894,4713,3,39],"tags":[2064,5205,5204],"class_list":["post-4631","post","type-post","status-publish","format-standard","hentry","category-others","category-tips-tricks","category-windows-10","category-windows-11","category-windows-7","category-windows-8","tag-disable-command-prompt","tag-disable-command-prompt-windows-11","tag-prevent-access-to-the-command-prompt"],"_links":{"self":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/4631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/comments?post=4631"}],"version-history":[{"count":17,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/4631\/revisions"}],"predecessor-version":[{"id":19975,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/4631\/revisions\/19975"}],"wp:attachment":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/media?parent=4631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/categories?post=4631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/tags?post=4631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}