What is the easiest way to turn .exe into a service?

Degen

Elite Member
Joined
Apr 9, 2016
Messages
2,604
Reaction score
2,900
I need to add a .exe into a service on my vps so it keeps running even if i am not connected to the vps.

It is a mouse input program if you were wondering.
 
I also want to know the answer of this
 
Run the exe as usual. I thought the vps stays "on" even when you're not connected to it
 
If you want to run a exe file as a service you could try something e.g.
Code:
https://stackoverflow.com/a/3582179/1437261

Not sure if this is what you are looking for.
 
You can't just turn an exe into a service, you would need to rewrite parts of your application to get it working as a service.

If it requires mouse input, just leave the VPS running and disconnect from the RDP session.
 
Right. @Stewielenor it should stay active. I run multiple apps and never had any problem as long as VPS works it work. Can you please give us more info?
I basically recorded mouse keyboard actions that needs to wee done on repeat, but every program stops preforming when I disconnect from Remote desktop.
If you want to run a exe file as a service you could try something e.g.
Code:
https://stackoverflow.com/a/3582179/1437261

Not sure if this is what you are looking for.
read that this morning but I still don't know how to do it as I've never messed around with services.

You can't just turn an exe into a service, you would need to rewrite parts of your application to get it working as a service.

If it requires mouse input, just leave the VPS running and disconnect from the RDP session.
I did and it doesn't work. App counter does go up but the actions are not preformed.
 
I basically recorded mouse keyboard actions that needs to wee done on repeat, but every program stops preforming when I disconnect from Remote desktop.
read that this morning but I still don't know how to do it as I've never messed around with services.

I did and it doesn't work. App counter does go up but the actions are not preformed.
Have you tried to program it? Like with you or xeboposter or winautomation
 
Run as administrator

"SC CREATE "MySVC" binpath= "C:\myservice.exe"


you're welcome
 
Run as administrator

"SC CREATE "MySVC" binpath= "C:\myservice.exe"


you're welcome
I got the error mentioned in the answer Error 1053: The service did not respond to the start or control request in a timely fashion.
 
Question - is your RDP session locking due to a screensaver or something?
 
"Task Scheduler"

You can set it to start once the server starts. triggers, or repeatedly in time intervals. It also can check if the program is already running and not run it multiple times. It is like the Windows version of Linux con jobs.

Service are harder. Unless the .exe was coded to be a service, windows will not start it as a service.
 
A service is a special program that runs without a visual interface. So, if your executable has a visual interface, then you couldn't run as service.
 
"Task Scheduler"

You can set it to start once the server starts. triggers, or repeatedly in time intervals. It also can check if the program is already running and not run it multiple times. It is like the Windows version of Linux con jobs.

Service are harder. Unless the .exe was coded to be a service, windows will not start it as a service.
Yeah this.
It looks like may be you don't need a service really? If it is for some kind of automation software, task scheduler could do the job.
 
Back
Top