This article is explaining about how to Install/Create and Delete/Remove a Windows Service using Command Prompt. You can use the Service Control Manager’s utility command sc to Install and Delete Windows Service.
Note: Run the command prompt with elevated privileges(Run as administrator) to use the command sc.
Install Windows Service using Command Prompt
Use the below command to install a Windows Service.
sc create [service-name] binpath= [servic-file-path]
service-name : Name of new Windows Service.
servic-file-path : File path of Windows Service file
sc create "MorganTechService" binpath= "C:\Program FilesMorganTechSPacemyservice.exe"
Delete Windows Service using Command Prompt
Use the below command to uninstall a Windows Service.
sc delete "MorganTechService"
Advertisement