Thursday, January 30, 2025
HomeTechCreate Windows service from executable

Create Windows service from executable

To create a Windows Service from an executable (.exe), follow these steps:

  1. Use sc.exe (Service Control Manager):
    Open Command Prompt as Administrator and run:

    sh
    sc create MyService binPath="C:\path\to\your.exe"

    This registers the service.

  2. Use nssm (Non-Sucking Service Manager):
    • Download NSSM.
    • Run:
      sh
      nssm install MyService
    • Choose your .exe and configure options.
  3. Start the Service:
    sh
    net start MyService

    This method ensures your executable runs as a background Windows service.

Previous article
Next article
RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x