{"id":1329,"date":"2015-04-20T06:00:10","date_gmt":"2015-04-20T13:00:10","guid":{"rendered":"http:\/\/www.coretechnologies.com\/blog\/?p=1329"},"modified":"2022-03-28T00:05:53","modified_gmt":"2022-03-28T07:05:53","slug":"windows-service-vs-regular-application","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/windows-services\/windows-service-vs-regular-application\/","title":{"rendered":"Top 10 differences between a Windows Service and a regular application"},"content":{"rendered":"<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"\/blog\/images\/whats-the-difference.webp\" alt=\"What's the difference between an application and a service?\" title=\"What's the difference between an application and a service?\" width=\"274\" height=\"274\" border=\"0\" \/><\/div>\n<p>\nFirst, let&#8217;s start with some definitions&#8230;\n<\/p>\n<h2><b>What is a regular application?<\/b><\/h2>\n<p>\nA <b>regular application<\/b> is one that you start and run on your Windows desktop. You launch it from a desktop icon, by double-clicking an associated document, or by typing its name at a command prompt. Examples include Microsoft Excel, Adobe Reader, Google Chrome and virtually any other program you consciously interact with on your PC. These are the programs that you know, love and use every day &#8212; the ones that make your computer a remarkably powerful tool.\n<\/p>\n<h2><b>What is a windows service?<\/b><\/h2>\n<p>\nA <b><a href=\"\/WindowsServices\/FAQ.html#WhatIsAWindowsService\" target=\"_blank\" rel=\"noopener noreferrer\">Windows Service<\/a><\/b> is a special program designed to &#8220;plug into&#8221; Windows. It typically chugs along doing its work in the background, never revealing itself, with little or no attention from anyone using the PC. It turns out that a whole host of these invisible workers are necessary to make your PC work smoothly! For example, the <b>Print Spooler<\/b> windows service ensures that your documents arrive at the printer, while the <b>Workstation<\/b> service makes the Internet available for all applications. Important tasks indeed!\n<\/p>\n<h2><b>What&#8217;s the difference?<\/b><\/h2>\n<p>\nSo with those basics in place, here are the 10 most important ways that a windows service differs from a regular application:\n<\/p>\n<ol>\n<li>\n<p>\nA windows service can <b>start automatically at boot<\/b>, without anyone having to log on. A regular application only runs when a user is logged in. This key distinction makes the windows service framework the better choice for software that must run 24&#215;7, surviving the inevitable reboot along the way.\n<\/p>\n<\/li>\n<li>\n<p>\nA windows service <b>won&#8217;t exit when you or anyone else logs off the PC<\/b>. A regular application will stop when you log out.\n<\/p>\n<\/li>\n<li>\n<p>\nWindows services <b>don&#8217;t run visibly on your desktop<\/b> (not since Vista). They are confined to the <a href=\"\/WindowsServices\/FAQ.html#WhatIsSession0Isolation\" target=\"_blank\" rel=\"noopener noreferrer\">isolated Session 0<\/a> and can not (usually) show their windows or tray icons to anyone logging into the PC. This restriction makes it very difficult for a windows service to interact with someone using the computer and consequently Microsoft <a href=\"\/WindowsServices\/FAQ.html#GUIServices\" target=\"_blank\" rel=\"noopener noreferrer\">strongly discourages implementing GUI services<\/a>.\n<\/p>\n<\/li>\n<li>\n<p>\nA windows service can be easily <b>started or stopped from the command line<\/b> using the <a href=\"\/blog\/windows-services\/essential-tools-for-windows-services-net-command\/\" target=\"_blank\" rel=\"noopener noreferrer\">NET<\/a> or <a href=\"\/blog\/windows-services\/essential-tools-windows-services-sc-exe\/\" target=\"_blank\" rel=\"noopener noreferrer\">SC<\/a> commands. This capability is a boon to sysadmins and technical folks, who can conveniently manage a service&#8217;s lifetime through unattended, administrative scripts.<br \/>\n<a href=\"\/blog\/images\/net-command-line.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Starting\/stopping a service with the NET Command\" target=\"_blank\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/net-command-line.png\" border=\"0\" title=\"Starting\/stopping a service with the NET Command (click to enlarge)\" alt=\"Starting\/stopping a service with the NET Command\" width=\"520\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<li>\n<p>\nOnly a <b>single instance<\/b> of a windows service can be started at any time. That single copy must serve all users on the PC. This is very different than a regular application, which typically permits multiple copies, especially when several people are logged in.\n<\/p>\n<\/li>\n<li>\n<p>\nServices typically run in the <b>Local System account<\/b>, which has administrative powers over many aspects of the PC. Thus your average service will have more rights and control over your computer than your typical application running in the context of a regular user&#8217;s account.<br \/>\n<a href=\"\/blog\/images\/services-log-on-tab-local-system-account.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Services Log On tab\" target=\"_blank\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/services-log-on-tab-local-system-account.png\" width=\"420\" height=\"475\" border=\"0\" title=\"Services Log On tab (click to enlarge)\" alt=\"Services Log On tab\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<li>\n<p>\nWhen run as LocalSystem, a service has access to UNC paths (for example, <nobr>&#8220;\\\\server\\data&#8221;<\/nobr>) but <b>cannot access mapped drive letters<\/b>. You should run the service in a regular user account to access network drives, and even then the service may have to map drives explicitly (for example, with the NET USE command) to gain access.\n<\/p>\n<\/li>\n<li>\n<p>\nAll windows services support sophisticated <b>recovery options<\/b> for when they stop unexpectedly. You can restart the service, run a command line or even reboot the computer.<br \/>\n<a href=\"\/blog\/images\/windows-service-recovery-tab.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Windows Service Recovery Tab\" target=\"_blank\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/windows-service-recovery-tab.png\" width=\"420\" height=\"475\" border=\"0\" title=\"Windows Service Recovery Tab (click to enlarge)\" alt=\"Windows Service Recovery Tab\" \/><br \/>\n<\/a><\/p>\n<\/li>\n<li>\n<p>\nWhile each regular application is backed by a single, unique process, it is possible for many services to <b>share a single running process<\/b>. This situation makes it possible for some services to start rapidly and make efficient use of resources &#8212; important characteristics for critical components that must always be available.\n<\/p>\n<\/li>\n<li>\n<p>\nA windows service <b>must contain special code<\/b> to respond to instructions from the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Service_Control_Manager\" target=\"_blank\" rel=\"noopener noreferrer\">Windows Service Control Manager (SCM)<\/a>. For the technical folks, this means implementing the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms685984%28v=vs.85%29.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">ServiceMain<\/a> (or equivalent) entry point in your application.\n<\/p>\n<\/li>\n<\/ol>\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\/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\/windows-server-2025-preview\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Looking Good on Windows Server 2025\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/windows-server-2025-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\">Looking Good on Windows Server 2025<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/spooler\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Essential Windows Services: Spooler\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/computers-printing-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 Windows Services: Spooler<\/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>First, let&#8217;s start with some definitions&#8230; What is a regular application? A regular application is one that you start and run on your Windows desktop. You launch it from a desktop icon, by double-clicking an associated document, or by typing &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/windows-service-vs-regular-application\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[108,139,151,196],"class_list":["post-1329","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-services","tag-net-exe","tag-sc-exe","tag-services-msc","tag-windows-services-2"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/1329","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=1329"}],"version-history":[{"count":2,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/1329\/revisions"}],"predecessor-version":[{"id":11100,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/1329\/revisions\/11100"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/2234"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=1329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=1329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=1329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}