Windows Command #41 – sc create (Windows OS)

Editorial photograph of a laptop displaying source code in a technical workspace.

sc.exe create registers a new Windows service with the Service Control Manager. It creates the service entry and stores configuration such as the service name, executable path, startup mode, account, dependencies, and display name. It follows Windows Command #40 — sc description, which changes the descriptive text of an already registered service.

Computer screen showing programming code in a developer workspace.
Creating a Windows service is a systems-administration task that connects an executable to the Service Control Manager. Photo: Unsplash.

Basic Syntax

sc.exe create ServiceName binPath= "C:\Path\To\Service.exe"

Microsoft documents sc.exe create as creating a service subkey and entries in both the registry and the Service Control Manager database. The binPath= parameter is required because Windows needs to know which service binary should be launched.

The Space After the Equal Sign Matters

The SC command-line syntax is unusual: the option name includes the equal sign, and Microsoft specifically requires a space between the option and its value. In other words, write binPath= "C:\Services\Example.exe", not binPath="C:\Services\Example.exe".

sc.exe create ExampleService binPath= "C:\Services\ExampleService.exe"

A successful registration normally returns [SC] CreateService SUCCESS. That message means Windows created the service entry; it does not prove the executable will successfully run as a service.

A direct walkthrough of using sc.exe to register an executable as a Windows service and then verify and manage the new service.

Not Every EXE Is a Windows Service

This is the most important limitation in the lesson. sc.exe create can register a binary path, but an ordinary desktop application does not automatically become a proper Windows service. The executable must be designed to communicate with the Service Control Manager and respond to service-control requests. Microsoft’s .NET Windows Service guidance shows this explicitly by building a worker application that supports the Windows service model before registering it with sc.exe.

If a normal application is registered as a service without implementing the required service behavior, creation can succeed while startup later fails. A common symptom is Error 1053, where Windows reports that the service did not respond to the start or control request in time.

A directly relevant sysadmin discussion explains that sc.exe create can register a service, but the executable still has to be capable of operating as a Windows service.

Choose the Startup Type

The start= option controls how Windows is configured to start the service. Microsoft documents values including auto, demand, disabled, and delayed-auto. If you omit the setting, the documented default for ordinary services is manual or demand start.

sc.exe create ExampleService binPath= "C:\Services\ExampleService.exe" start= auto

Do not choose automatic startup simply because it is available. A service that starts at boot becomes part of the operating system’s startup workload. Use the mode required by the application and operational design.

Set a Friendly Display Name

sc.exe create ExampleService binPath= "C:\Services\ExampleService.exe" displayName= "Example Background Service"

The internal service name is what administrators and scripts use with SC commands. The display name is the friendlier label shown in interfaces such as services.msc. Keeping the two concepts separate makes service troubleshooting much easier.

Verify Immediately After Creation

After creating a service, inspect its stored configuration before attempting to start it. sc.exe qc is the natural verification command because it displays the saved binary path, startup type, service account, dependencies, and other configuration.

sc.exe create ExampleService binPath= "C:\Services\ExampleService.exe" start= demand
sc.exe qc ExampleService
sc.exe qdescription ExampleService
sc.exe query ExampleService

The sequence checks configuration, description, and current state separately. A newly created demand-start service will normally exist without already being in the running state.

Start Only After the Configuration Looks Correct

sc.exe start ExampleService
sc.exe query ExampleService

sc start asks the Service Control Manager to start the service. If startup fails, inspect the service configuration, application logs, and Windows Event Viewer before repeatedly retrying. A correct sc create command cannot compensate for a service binary that is missing, misconfigured, or not designed to run as a service.

Add a Description Separately

After the service exists, use sc.exe description to document its purpose. Keeping creation and description as separate commands also makes deployment scripts easier to read and troubleshoot.

sc.exe create ExampleService binPath= "C:\Services\ExampleService.exe" start= demand
sc.exe description ExampleService "Background service used by the lab application."
sc.exe qdescription ExampleService

Remote Service Creation

SC supports a remote server name in UNC form. Remote service creation is an administrative change and requires the necessary permissions and network access to the remote Service Control Manager.

sc.exe \\SERVER01 create ExampleService binPath= "C:\Services\ExampleService.exe"

Remember that the binary path is interpreted on the target computer. A path that exists on your workstation is not automatically present on SERVER01.

Use sc.exe in PowerShell

In Windows PowerShell, use sc.exe explicitly rather than only sc. The short name can resolve to the PowerShell Set-Content alias. Writing the executable name removes that ambiguity.

Quick Lab

  1. Use a Windows lab VM and a genuine test service executable designed for the Windows service model.
  2. Open an elevated Command Prompt or PowerShell window.
  3. Run sc.exe create LabService binPath= "C:\Lab\LabService.exe" start= demand.
  4. Run sc.exe qc LabService and verify the binary path and startup type.
  5. Use sc.exe description LabService "Temporary service used for command practice.".
  6. Run sc.exe qdescription LabService.
  7. Start the service only if the executable is known to be a valid service and the lab calls for it.
  8. Remove the lab service afterward using the appropriate deletion procedure rather than leaving unused service entries behind.

Knowledge Check + Answers

  1. What does sc.exe create do? It registers a new Windows service with the Service Control Manager and stores its configuration.
  2. Which parameter is required? binPath=, because Windows needs the service binary path.
  3. Why is the spacing unusual? SC requires the equal sign as part of the option name and a space before the value.
  4. Can any EXE be turned into a proper service just by registering it? No. The executable must support the Windows service model or use an appropriate service-hosting approach.
  5. Which command should verify the new service configuration? sc.exe qc.
  6. Does CreateService success mean the service will definitely start? No. It only confirms registration succeeded.

Previous Windows Commands

Editor’s Note

The featured image and body image are separate. The lesson uses only normal responsive Gutenberg headings, paragraphs, lists, images, embeds, and code blocks for real commands. There are no decorative text boxes, cards, callouts, shaded panels, or fixed-width prose containers.

BitcoinVersus.Tech is not a financial advisor. Content is provided for informational and educational purposes.

Leave a comment