sc.exe create binPath= "" You must have quotation marks around the actual exe path, and a space after the binPath= . More information on the sc command can be found in Microsoft KB251192 .

In this case I can't kill the process as it stops the other service also. (Note that DcomLaunch is an essential service on the system and killing it can even shutdown the system) In the case of svchost not being shared with any other service you can go ahead and kill TermService process by the following command. taskkill /F /PID process_id How To Turn Off Microsoft Compatibility Telemetry Jul 04, 2020 What Is wmpnetwk.exe And Why Is It Running? Oct 03, 2019 Creating a Linux service with systemd | by Benjamin Morel Sep 05, 2017

Using Powershell to create an exe to run as a service

Jan 22, 2012 What is the easiest way to turn .exe into a service

The problem we quickly run into is that MyProgram.exe is not aware of how to behave like a service, so the Service Control Manager (SCM) will shut it down shortly after it starts. We can get around this by making a different program call MyProgram.exe in the binpath configuration.

How to convert a BAT script to an EXE on Windows 10