Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Windows: Create (Install) a Service Manually

December 17, 2025

Windows: Create (Install) a Service Manually

In Windows, services are used to run app binaries in the background, typically without requiring user interaction. Services can automatically start during Windows boot and run continuously in the background until system shutdown. This post explains how to create a new system service from an executable binary file.

There are several built-in Windows tools that allow administrators to create new services via the command prompt. These include the sc.exe console command and the New-Service PowerShell cmdlet.

The following command will create a new service from the specified executable file with additional arguments:

sc create CorpCollectorService binPath= "C:\Program Files (x86)\CORP\collector.exe -i C:\tools\config.xml" start= auto DisplayName= "CORP Log Collector Service"

sc create Windows service from cmd

If the command is executed successfully, a message will appear:

[SC] CreateService SUCCESS

The following arguments are used:

  •  CorpCollectorService – new service name
  •  binPath – contains the full path to the executable file, along with any required launch arguments (in quotation marks if there are any spaces)
  •  start= auto – start the service automatically at Windows boot (boot|system|auto|demand|disabled).
  •  DisplayName — service display name

Additional parameters can be used:

  • type — type of service. By default, own is used, meaning that the service runs in its own process. You can also specify here: own|share|kernel|filesys|adapt|rec|interact
  • By default, the service runs on behalf of Local System. If you need to run the service on behalf of a specific user account, specify the username and password using the options:  obj= "woshub\user1" password= "myUserPassw0r1"

Now, open the Services graphical service management snap-in (services.msc). The new service will appear in the list of services (press F5 to refresh the Service Manager database). Here you can start or stop the service, or change the startup type. new service appears in Services management console

All service settings are stored under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ registry key. The CorpCollectorService subkey was created automatically for the new service.

Services settings are stored in the registry

Here is a similar PowerShell command for creating a new service:

New-Service -Name CorpCollectorService -BinaryPathName "C:\Program Files (x86)\CORP\collector.exe -i C:\tools\config.xml" -DisplayName "my test service" -Description "CORP Log Collector Service" -StartupType "Automatic"

New-Service: create service using PowerShell

If you need to configure a username and password to start the service, use the following syntax:

$username = "user123"
$password = "PaSSw0rd1"
$securepassword = ConvertTo-SecureString $password -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($username, $securepassword)
New-Service … -Credential $cred

To properly remove a service in Windows, use the following command:

sc delete service_name1

Note that not all executable binaries can operate successfully as Windows services. The application must be specifically designed to operate as a service that responds to commands from the Service Control Manager (SCM). Error 1053 will appear when attempting to start a service that is unable to handle SCM control signals:

Windows could not start the MyService1 service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.

Windows could not start the service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion.

Several third-party tools can be used to create a service from a program that is not designed to run in Windows service mode (including those with graphical interfaces). The Windows Server Resource Kit 2003 included srvany.exe  and instsrv.exe  commands, which could be used to create a service from any binary. However, it is now preferable to use the modern NSSM (Non-Sucking Service Manager) tool. Unlike legacy Microsoft tools, it monitors running app processes and offers advanced process management capabilities. NSSM can run any app, script, or executable as a reliable background Windows Service, and automatically restart it if it crashes.

NSSM can be installed using the WinGet package manager:

winget install --id NSSM.NSSM -e

Now, to create a service from any executable, run:

nssm install testservice "C:\Tools\collector.exe"

Note that in the new service’s properties, nssm.exe  serves as the executable launcher for your application binary.

Create a service using NSSM

NSSM provides a simple GUI that enables convenient configuration of service parameters.

For example, to edit a previously created service, run:

nssm edit testservice

NSSM service editor GUI

We have previously demonstrated how to use NSSM to run a PowerShell script as a system service.
0 comment
0
Facebook Twitter Google + Pinterest
Windows 11Windows Server 2025
previous post
Windows: Auto Switch to Strongest Wi-Fi Network
next post
How to Create a User Account Without a Password on Windows

Related Reading

Configuring RemoteApps Hosted on Windows 10/11 (without Windows...

January 25, 2025

Fix: Windows Update Tab (Button) is Missing from...

December 16, 2024

How to Prefer IPv4 over IPv6 in Windows...

April 15, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 23, 2025

How to Detect Which User Installed or Removed...

June 25, 2025

Find a Process Causing High Disk Usage on...

July 16, 2025

Map a Network Drive over SSH (SSHFS) in...

May 13, 2025

Unable to Select Edition During Windows 10/11 Installation

February 4, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Windows: Create (Install) a Service Manually

    December 16, 2025
  • Windows: Auto Switch to Strongest Wi-Fi Network

    December 10, 2025
  • How to Enable or Disable VBScript in Windows after Deprecation

    December 10, 2025
  • Start Menu Not Working (Unresponsive) on Windows Server RDS

    November 27, 2025
  • AppLocker: Configure Application Restriction Policies in Windows

    November 19, 2025
  • Enable/Disable Random Hardware (MAC) Address for Wi-Fi on Windows

    November 14, 2025
  • Automate Software and Settings Deployment with WinGet Configure (DSC)

    November 13, 2025
  • SMB over QUIC: Mount File Share over Internet without VPN on Windows Server 2025

    November 4, 2025
  • How to Find a Previous Computer Name in Windows

    October 28, 2025
  • Stop Windows Server from Auto-Shutdown Every Hour

    October 22, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Upgrading to Windows 11 on Unsupported Hardware
  • Create a Custom Windows Image with Pre-installed Apps
  • Install Any OS from ISO Image over Network with iVentoy
  • Permanently Disable Driver Signature Enforcement on Windows 11
  • Configuring RemoteApps Hosted on Windows 10/11 (without Windows Server)
  • SMB over QUIC: Mount File Share over Internet without VPN on Windows Server 2025
  • Run PowerShell Scripts on a Schedule with Task Scheduler
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top