exe run as service - Forum

Forum Navigation
You need to log in to create posts and topics.

exe run as service

I need to run a program as a service, so it needs to start even before entering the login password.

I have already tried NSSM https://nssm.cc/download but the program does not start.
Anyone have any ideas?
Thank you

Hi,

I can write this program, what should it do?

Regards

the nssm work all the time for me maybe you doing something wrnog

but there are other apps to do this like :

FireDaemon , RunAsService , winsw ,

even you can do this with powershell cmmand

the command for make service is :

New-Service -Name "ExampleService" -DisplayName "Example Service" -Description "An Example Service" -StartupType Manual -BinaryPathName "Path-To-App.exe --service"
the full guide of powershell is here 

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-service?view=powershell-7.3
and
https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-manager/run-an-application-as-a-windows-service.html

i recommend to use (RunAsService) app its easy
http://runasservice.com/


 

 

CN_Iceman has reacted to this post.
CN_Iceman
Quote from farhad2008 on October 21, 2023, 12:39 pm

Hi,

I can write this program, what should it do?

Regards

I have a utility that works on all PCs in my office.

I need more control, so it's important that this utility can run as a service.

I will try Victor's solutions, but if you think you have other ideas I will gladly try them.
Thank you

 

Quote from victor on October 21, 2023, 12:57 pm

the nssm work all the time for me maybe you doing something wrnog

but there are other apps to do this like :

FireDaemon , RunAsService , winsw ,

even you can do this with powershell cmmand

the command for make service is :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
New-Service -Name "ExampleService" -DisplayName "Example Service" -Description "An Example Service" -StartupType Manual -BinaryPathName "Path-To-App.exe --service"
New-Service -Name "ExampleService" -DisplayName "Example Service" -Description "An Example Service" -StartupType Manual -BinaryPathName "Path-To-App.exe --service"
New-Service -Name "ExampleService" -DisplayName "Example Service" -Description "An Example Service" -StartupType Manual -BinaryPathName "Path-To-App.exe --service"
the full guide of powershell is here https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-service?view=powershell-7.3 and https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-manager/run-an-application-as-a-windows-service.html i recommend to use (RunAsService) app its easy http://runasservice.com/

 

 

Thanks, I'll try RunAsService

victor has reacted to this post.
victor

WinSW is my solution, but.... the only problem is that programs made with VNW don't work.

WinSW correctly generates the service and runs it.

The problem is that the executable ( see Task Manager ) is executed but as a background process.
It is in memory but is not executed, because is not a Apps.

In your opinion, is there a solution?

 

apps made by VNW are gui app i think thats a problem

i also have the app name (AlwaysUp) that claim can run even gui app as service

try maybe solve your problem