{"id":183,"date":"2012-07-19T11:40:17","date_gmt":"2012-07-19T15:40:17","guid":{"rendered":"https:\/\/jeremystein.com\/brain\/?p=183"},"modified":"2012-07-19T11:40:17","modified_gmt":"2012-07-19T15:40:17","slug":"scheduled-task-running-as-local-service-cant-run-net-stop","status":"publish","type":"post","link":"https:\/\/jeremystein.com\/brain\/scheduled-task-running-as-local-service-cant-run-net-stop\/","title":{"rendered":"Scheduled Task running as Local Service can&#8217;t run net stop"},"content":{"rendered":"<p>I tried to create a scheduled task in Windows Server 2008 to run a batch file that calls NET STOP.  I configured it to use LOCAL SERVICE and I checked &#8220;Run with highest privileges&#8221;.<\/p>\n<p>I kept getting permission errors:<\/p>\n<blockquote><p>System error 5 has occurred.<\/p>\n<p>Access is denied.\n<\/p><\/blockquote>\n<p>(Interestingly, this exits with errorlevel 2, which seems to be documented nowhere.)<\/p>\n<p>I finally realized that I should be running as SYSTEM, not LOCAL SERVICE.  <a href=\"http:\/\/stackoverflow.com\/a\/510225\/9702\">I learned the difference<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I tried to create a scheduled task in Windows Server 2008 to run a batch file that calls NET STOP. I configured it to use LOCAL SERVICE and I checked &#8220;Run with highest privileges&#8221;. I kept getting permission errors: System error 5 has occurred. Access is denied. (Interestingly, this exits with errorlevel 2, which seems [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-windows-batch-files"],"_links":{"self":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}