Creating a Windows Service from an executable file

bardimin pic

Written by Bardimin

On May 25, 2022
Home » Blogs » Windows » Creating a Windows Service from an executable file

Services are programs that run in the background according to the interface rules and protocols of the Service Control Manager, the component responsible for managing Services.

This service you can start automatically when the boots, can be paused and restarted, and does not display any user interface.

You can easily create Windows Service by using exe file.

You can add or create a in many ways. In this article, Bardimin will create using (CMD) and Non-Sucking Service Manager (NSSM).

Before starting, prepare the exe or bat file that you will use as a service.

Creating a Windows Service using CMD

  1. Open CMD as .
  2. Type the following code in the CMD window.
sc.exe create < service_name > displayname = < displayname > binpath = < path_file_executable >
  • service_name : a unique service name.
  • display_name : the name displayed on the interface.
  • path_file_executable : where the exe or bat file is located.

as an example

sc.exe create “ BardiminServ ” displayname = “Bardimin Service” binPath = "C:\BardiminApp.exe"
sc command

Creating a Windows Service using NSSM

  1. Download NSSM .
  2. Extract the downloaded zip file.
  3. Open CMD and change to the extracted file directory. Then type the following code to open the NSSM GUI
nssm install
nssm service
  1. Then fill in the location of your exe file and the name of the service.
  2. Then click the “Install Service” button

Latest Articles

Redirect and Block URLs with HOSTS File on Windows

Redirect and Block URLs with HOSTS File on Windows

Redirect and Block URLs you can easily on Windows. Just by adding the IP of a website, you can redirect or block it. Of course, this is very useful to limit the access of your employees or children from accessing websites that you do not allow. Your Windows PC has...

How to Create Fake Files of Any Size in Windows

How to Create Fake Files of Any Size in Windows

Do you need a file with a size of 10 MB, 100 MB, 1 GB or 1 TB to test? Follow the following article to create one instantly. You don't need to download files or waste time searching for large files, you can create them easily. Sometimes you need large files quickly to...

10 Causes of Windows PC crashes you should know

10 Causes of Windows PC crashes you should know

A fatal error will cause the system to become unstable or busy. Your Windows PC will often display the Blue Screen of Death (BSOD). Do you experience it often? A computer that often crashes is quite annoying for all users, especially when you are doing important work...