In Windows, running a software as a service is a terrific approach to make sure that it launches right away. This is particularly beneficial for applications that carry out essential tasks, including antivirus software and backup utilities. This article will cover how to add, register, and create services as well as how to install software as a Windows service.
You will require a third-party tool, such as NSSM (Non-Sucking Service Manager) or Microsoft’s SC.EXE application, in order to install a software as a service. NSSM is a free, open-source utility with many configuration options that is simple to use. Windows includes a command-line tool called SC.EXE that can be used to build, set up, and manage services.
1. Extract the ZIP file containing NSSM to a location on your computer after downloading it from the official website.
3. Execute the ensuing command to set up the application as a service: Path to executable:
”’
nssm install’servicename’
“`
servicename> and pathtoexecutable> should be changed to reflect the name of the service and the executable file’s entire path, respectively, for the program you want to run as a service.
5. To install the service, click the Install Service option.
1. Launch a command window with administrative rights.
2. To create a new service, execute the following command: Replace “servicename” with the name you want to give the service and “pathtoexecutable” with the whole path to the executable file for the program you want to execute as a service in the command “sc create servicename> binPath= “pathtoexecutable>”
3. Issue the command
”’
sc config servicename> start= starttype> to set up the service. Replace servicename> with the name of the newly formed service, and starttype> with the desired startup type (such as “auto” or “demand”).
4. To start the service, enter the following command:
”’
sc start servicename>.
”’
Substitute the name of the newly formed service for servicename>. How to Include a Service
1. Press the Windows key + R, type “services.msc” (without the quotations), then press Enter to launch the Services console.
3. In the right pane, right-click an empty space and choose New > Service.
5. As needed, configure the starting type, logon account, and other settings. 6. Press OK to start the service.
In Windows 10, you can use the REGSVR32 command to register a service. Take these actions:
2. Locate the location where the service executable file is located.
4. You will receive a notice stating that the DLL was registered if the registration is successful.
Using NSSM, a Windows service can be produced from a batch file. Take these actions:
2. Download NSSM to your computer and extract it to a directory.
4. To install the batch file as a service, issue the following command: ”’
nssm install’servicename’ ‘pathtobatchfile’ servicename> and pathtobatchfile> should be changed to reflect the name you want to give the service. 5. Configure the service as necessary in the NSSM Service dialog box. 6. To install the service, click the Install Service option.
The procedures below should be followed to build a Windows service in Visual Studio: Open Visual Studio, then start a new project. 2. From the list of project templates, pick the Windows Service template.
5. Build the project to generate the executable file for the service.
Finally, setting up an application as a service in Windows is a quick but effective technique to make sure that crucial apps launch immediately after the computer powers up. The procedure is simple and well-documented, whether you use Microsoft’s SC.EXE application or a third-party tool like NSSM. Additionally, using built-in Windows tools and utilities, adding, registering, and establishing services are all quite simple operations that may be completed.