{"id":324,"date":"2013-12-28T13:31:21","date_gmt":"2013-12-28T21:31:21","guid":{"rendered":"http:\/\/www.coretechnologies.com\/blog\/?p=324"},"modified":"2021-04-30T07:18:06","modified_gmt":"2021-04-30T14:18:06","slug":"essential-tools-for-windows-services-net-command","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/windows-services\/essential-tools-for-windows-services-net-command\/","title":{"rendered":"Essential Tools for Windows Services: The NET Command"},"content":{"rendered":"<p><!-- Video: How to use NET to Start and Stop your Windows Services. --><\/p>\n<div align=\"left\" class=\"video-responsive image-padding\">\n<iframe width=\"560\" height=\"315\" class=\"lazyload\" data-src=\"\/\/www.youtube.com\/embed\/SsHR-BEy0U4?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe>\n<\/div>\n<hr>\n<p style=\"margin-top:24px;\">If you manage Windows Services and are comfortable working from the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/administration\/windows-commands\/windows-commands\" target=\"_blank\" rel=\"noopener noreferrer\">command line<\/a>, then the Windows NET.EXE command should be in your toolkit. Use it to easily start, stop, pause or restart any service from an <a href=\"\/WindowsServices\/FAQ.html#ElevatedPrompt\" target=\"_blank\" rel=\"noopener noreferrer\">elevated command prompt<\/a>, or in a convenient script\/batch file.\n<\/p>\n<h2 class=\"blog-caption\">Using NET to stop a Windows Service<\/b><\/h2>\n<p>To stop a service, run:<\/p>\n<blockquote><p><b>net stop &lt;Service-Name&gt;<\/b><\/p><\/blockquote>\n<p>where &lt;Service-Name&gt; is the <a href=\"\/WindowsServices\/FAQ.html#FindServiceName\" target=\"_blank\" rel=\"noopener noreferrer\">name of the service<\/a>. Be sure to enclose it in quotes if it contains a space!\n<\/p>\n<p>\nFor example, to stop the Print Spooler service (named &#8220;Spooler&#8221;), run:<\/p>\n<blockquote><p><b>net stop Spooler<\/b><\/p><\/blockquote>\n<p>\nHere is what it looks like on our Windows Server 2016 computer:<br \/>\n<a href=\"\/blog\/images\/stop-spooler-windows-service.gif\" class=\"zoomPopup\" title=\"NET: Stopping the Print Spooler Service\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/stop-spooler-windows-service.gif\" border=\"0\" title=\"NET: Stopping the Print Spooler Service (click to enlarge)\" alt=\"NET: Stopping the Print Spooler Service\" \/><\/a>\n<\/p>\n<p>Notice that the NET command will wait for the service to stop before continuing. The only exception is when the service is unresponsive or takes more than 30 seconds to comply.\n<\/p>\n<h2 class=\"blog-caption\">Starting a Windows Service with NET<\/h2>\n<p>To start an idle Windows Service, run:<\/p>\n<blockquote><p><b>net start &lt;Service-Name&gt;<\/b><\/p><\/blockquote>\n<p>If all goes well, your service (and any other service it depends on to operate) will be started after a few seconds:\n<\/p>\n<p>\n<a href=\"\/blog\/images\/start-spooler-windows-service.gif\" class=\"zoomPopup\" title=\"NET: Start the Print Spooler Service\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/start-spooler-windows-service.gif\" border=\"0\" title=\"NET: Start the Print Spooler Service (click to enlarge)\" alt=\"NET: Start the Print Spooler Service\" \/><\/a>\n<\/p>\n<h2 class=\"blog-caption\">How to Restart a Windows Service with NET.EXE<\/h2>\n<p>\nTo restart a service, say from a batch file, chain the &#8220;net stop&#8221; and &#8220;net start&#8221; commands together like this:<\/p>\n<blockquote><p><b>net stop &lt;Service-Name&gt;<br \/>\nnet start &lt;Service-Name&gt;<\/b><\/p><\/blockquote>\n<h2 class=\"blog-caption\">NET will also Pause and Resume Windows Services<\/h2>\n<p>\nNot all services support pause and resume, but if you have one that does, NET can come in handy there as well.\n<\/p>\n<p>\nTo pause a service, type:<\/p>\n<blockquote><p><b>net pause &lt;Service-Name&gt;<\/b><\/p><\/blockquote>\n<p>\nTo resume a paused service, run:<\/p>\n<blockquote><p><b>net continue &lt;Service-Name&gt;<\/b><\/p><\/blockquote>\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\/alwaysup\/restart-service-regularly\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q &amp; A: How do I Restart my Application\/Service Regularly from AlwaysUp?\"  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: How do I Restart my Application\/Service Regularly from AlwaysUp?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/eventlog\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Essential Windows Services: EventLog \/ Windows Event Log\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/eventlog-service-150x150-1.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 Windows Services: EventLog \/ Windows Event Log<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/memory-fix-june-2020-patch\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Windows Services Memory Fix (Microsoft June 2020 Patch Tuesday)\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/software-bug-150x150-1.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\">Windows Services Memory Fix (Microsoft June 2020 Patch Tuesday)<\/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>If you manage Windows Services and are comfortable working from the command line, then the Windows NET.EXE command should be in your toolkit. Use it to easily start, stop, pause or restart any service from an elevated command prompt, or &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/essential-tools-for-windows-services-net-command\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2263,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[77,108,196],"class_list":["post-324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-services","tag-essential-tools","tag-net-exe","tag-windows-services-2"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/324","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=324"}],"version-history":[{"count":3,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/324\/revisions"}],"predecessor-version":[{"id":10475,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/324\/revisions\/10475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/2263"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}