{"id":7056,"date":"2019-04-16T05:59:46","date_gmt":"2019-04-16T12:59:46","guid":{"rendered":"https:\/\/www.coretechnologies.com\/blog\/?p=7056"},"modified":"2022-02-21T21:48:21","modified_gmt":"2022-02-22T05:48:21","slug":"net-fix-access-denied","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/windows-services\/net-fix-access-denied\/","title":{"rendered":"Q&#038;A: NET STOP Fails with &#8220;Access is Denied&#8221;. How I Do Make it Work?"},"content":{"rendered":"<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"\/blog\/images\/qa-access-denied.webp\" title=\"Q &#038; A - Access Denied\" alt=\"Q &#038; A - Access Denied\" border=\"0\" width=\"380\" height=\"154\"><\/div>\n<div class=\"blog-qa-question-box\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cdn.coretechnologies.com\/images\/quotes-transparent-21x21.png\" width=\"21\" height=\"21\">&nbsp;&nbsp;I followed <a href=\"\/blog\/windows-services\/essential-tools-for-windows-services-net-command\/\">your NET article<\/a> on how to stop a service but when I run <b>NET STOP<\/b> it fails with &#8220;System error 5 has occurred Access is denied&#8221;. <\/p>\n<p>It looks like a permissioning issue but do you have any way to get it to work? Did I do something wrong?<\/p>\n<p align=\"right\">&mdash; Ian<\/p>\n<\/div>\n<p>Hi Ian.<\/p>\n<p>Yes, this is definitely a problem with permissions. You can see that it happens on our Windows 10 system too:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/net-stop-access-denied.gif\" class=\"zoomPopup\" title=\"NET STOP: Access Denied\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/net-stop-access-denied.gif\" title=\"NET STOP: Access Denied (click to enlarge)\" alt=\"NET STOP: Access Denied\" border=\"0\" ><\/a><\/div>\n<p>But you may be able to get around it! Here are our recommendations:<\/p>\n<h2 class=\"blog-caption-numbered\">1. Ensure that you are running NET from an elevated command prompt<\/h2>\n<p>Are you running NET STOP from a command prompt window? The access denied error will be raised if the prompt does not have sufficient rights to stop the service.<\/p>\n<p>You see, Windows typically starts the command prompt (and other applications) without administrative rights &mdash; even if you are an administrator on your computer. This policy &mdash; called <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/security\/identity-protection\/user-account-control\/how-user-account-control-works\" target=\"_blank\" rel=\"noopener noreferrer\">User Account Control (UAC)<\/a> &mdash; is an important security measure that protects your computer from viruses and other malicious activity.<\/p>\n<p>Because of UAC, you must explicitly indicate whenever you want to run an <b>elevated command prompt<\/b> &mdash; one with enough administrative rights to stop a Windows Service.<\/p>\n<p>To start an elevated command prompt (instructions for Windows 10):<\/p>\n<ol>\n<li>\n<p>Type <b>cmd<\/b> in the taskbar search box.<\/p>\n<\/li>\n<li>\n<p>An entry for the &#8220;Command Prompt&#8221; desktop app should appear in the list of results. Right-click that entry and choose <b>Run as administrator<\/b>:<\/p>\n<p>\n<a href=\"\/blog\/images\/run-cmd-as-administrator.png\" class=\"zoomPopup\" title=\"Run Command Prompt as administrator\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/run-cmd-as-administrator.png\" border=\"1\" alt=\"Run Command Prompt as administrator\" title=\"Run Command Prompt as administrator\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<li>\n<p>You may be prompted to confirm that you want to run as an administrator. Click <b>Yes<\/b> to proceed:<\/p>\n<p>\n<a href=\"\/blog\/images\/uac-prompt-confirm-cmd.png\" class=\"zoomPopup\" title=\"UAC: Confirm run as administrator\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/uac-prompt-confirm-cmd.png\" border=\"0\" alt=\"UAC: Confirm run as administrator\" title=\"UAC: Confirm run as administrator\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<\/ol>\n<p>\nThe elevated command prompt will appear on your desktop. The window&#8217;s caption should contain the word &#8220;Administrator&#8221; (which indicates that it is running with full admin rights).\n<\/p>\n<p>\n<a href=\"\/blog\/images\/elevated-comand-prompt.png\" class=\"zoomPopup\" title=\"Elevated Command Prompt\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/elevated-comand-prompt.png\" border=\"0\" alt=\"Elevated Command Prompt\" title=\"Elevated Command Prompt\" \/><br \/>\n<\/a>\n<\/p>\n<p>Try stopping your service with NET.EXE from there. Move on to the next recommendation if the problem persists.<\/p>\n<h2 class=\"blog-caption-numbered\">2. Grant yourself permission to stop\/start the service<\/h2>\n<p>Does the error still occur when you run NET from an elevated prompt? If so, it means that your Windows account does not have permission to stop the service. An administrator must grant you that right.<\/p>\n<p><b>Are you an administrator?<\/b> Maybe you can give yourself the right to stop the service! Our free <a href=\"\/products\/ServiceSecurityEditor\/\">Service Security Editor<\/a> should be able to help.<\/p>\n<p>To grant yourself stop-service rights:<\/p>\n<ol>\n<li>\n<p><a href=\"\/products\/ServiceSecurityEditor\/\">Download Service Security Editor<\/a> and save it to a known location<\/p>\n<\/li>\n<li>\n<p>Start Service Security Editor<\/p>\n<\/li>\n<li>\n<p>Select your service from the list and click <b>Open<\/b><\/p>\n<\/li>\n<li>\n<p>In the <b>Service Security Settings<\/b> window, select (or add) your account in the top pane and grant yourself the appropriate rights in the lower pane:<\/p>\n<p>\n<a href=\"\/blog\/images\/grant-stop-rights-spooler-service.png\" class=\"zoomPopup\" title=\"Grant service stop rights\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/grant-stop-rights-spooler-service.png\" border=\"0\" alt=\"Grant service stop rights\" title=\"Grant service stop rights\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<li>\n<p>Click <b>OK<\/b> to record your settings and <b>Done<\/b> to exit Service Security Editor<\/p>\n<\/li>\n<\/ol>\n<p>If that doesn&#8217;t work, then you don&#8217;t have permission to grant yourself rights to the service. You have one final option remaining&#8230;<\/p>\n<h2 class=\"blog-caption-numbered\">3. Ask your system administrator to grant you rights to the service<\/h2>\n<p>If an elevated prompt isn&#8217;t successful and you can&#8217;t give yourself the right to stop the service, you are stuck. <b>You simply do not have the authority to stop the service on your own.<\/b><\/p>\n<p>Please consult a system administrator. Explain what you are trying to do with the NET.EXE command and ask them to authorize you to stop the service. <\/p>\n<p>And be sure to let them know about Service Security Editor, which will help them to complete their task without fuss.<\/p>\n<p style=\"margin-top: 30px;\">\nAll the best!<\/p>\n<!-- relpost-thumb-wrapper --><div class=\"relpost-thumb-wrapper\"><!-- filter-class --><div class=\"relpost-thumb-container\"><style>.relpost-block-single-image, .relpost-post-image { margin-bottom: 10px; }<\/style><h3>You may also like...<\/h3><div style=\"clear: both\"><\/div><div style=\"clear: both\"><\/div><!-- relpost-block-container --><div class=\"relpost-block-container relpost-block-column-layout\" style=\"--relposth-columns: 3;--relposth-columns_t: 2; --relposth-columns_m: 2\"><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/essential-tools-for-windows-services-process-explorer\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Essential Tools for Windows Services: Process Explorer\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/process-explorer-150x150.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Essential Tools for Windows Services: Process Explorer<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/interact-with-desktop\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: Why doesn&#039;t Allow service to interact with desktop work?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/qa-150x150.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: Why doesn&#039;t &quot;Allow service to interact with desktop&quot; work?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/group-applications\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: Can I Group My Applications in AlwaysUp?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/alwaysup-group-applications-150x150-1.webp\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: Can I Group My Applications in AlwaysUp?<\/h2><\/div><\/div><\/a><\/div><!-- close relpost-block-container --><div style=\"clear: both\"><\/div><\/div><!-- close filter class --><\/div><!-- close relpost-thumb-wrapper -->","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;I followed your NET article on how to stop a service but when I run NET STOP it fails with &#8220;System error 5 has occurred Access is denied&#8221;. It looks like a permissioning issue but do you have any way &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/net-fix-access-denied\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":7070,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[108,127,148,173,196],"class_list":["post-7056","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-services","tag-net-exe","tag-qa","tag-service-security-editor-2","tag-user-account-control","tag-windows-services-2"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/7056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=7056"}],"version-history":[{"count":2,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/7056\/revisions"}],"predecessor-version":[{"id":10940,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/7056\/revisions\/10940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/7070"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=7056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=7056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=7056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}