Answer the question
In order to leave comments, you need to log in
How to add a windows service
Hello. Installed nginx on Windows XP, it is necessary that the command be
start D:\Webserver\nginx-0.9.5\nginx.exe
executed when the computer is turned on.
As far as I understand, you need to create a service =)
Answer the question
In order to leave comments, you need to log in
Throw the command into a .bat file, then throw it into autoload.
A better shortcut to nginx.exe in autoload.
support.microsoft.com/kb/137890
support.microsoft.com/kb/251192
www.anvir.com/run-programs-as-services-2.htm (Russian version is free)
In order for a program to run as a service, it must make some tricky API calls, which regular software usually doesn't. So use a banal autoload and don't reinvent the wheel.
Native solution Instsrv + Srvany, as many have already written above. Works great for me with uTorrent.
On the Internet, to create an Nginx service, they suggest using WinSW - projectkenai.com/projects/winsw/pages/Home
Parameters for creating a service for Nginx:
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<executable>c:\nginx\nginx.exe</executable>
<logpath>c:\nginx\</logpath>
<logmode>roll</logmode>
<depend></depend>
<startargument>-p c:\nginx</startargument>
<stopargument>-p c:\nginx -s stop</stopargument>
</service>
The simplest solution is to create a task (Start-> Accessories->System Tools->Scheduled Tasks)
This task can be set to start at computer startup, and this task will run even if no one is logged in.
sc create nginx binpath="D:\Webserver\nginx-0.9.5\nginx.exe" displayname="nginx" depend=Tcpip start=auto
Another option for working with services (deleting, creating, etc.) is through WMI. For example, here is the command to create a service: wmic service call create , where after create you need to enter the service parameters. Read more: wmic service call create /?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question