srvwrapper
Create Windows service from executable
Install
Step 1:
Download and install the srvwrapper package for python.
pip install srvwrapper
Step 2:
Use the srvwrapper command and pass the service name and program path to create a service. Other optional commands are listed with the --help command.
usage: srvwrapper [-h] [--arguments ARGUMENTS] [--display DISPLAY]
[--description DESCRIPTION] [--start START]
[--depend DEPEND] [--obj OBJ] [--password PASSWORD]
name program
Wrap any applications to run as Windows Service
positional arguments:
name service name
program application path
optional arguments:
-h, --help show this help message and exit
--arguments ARGUMENTS
arguments for program
--display DISPLAY the display name of the service
--description DESCRIPTION
service description
--start START how the service starts
<boot|system|auto|demand|disabled|delayed-auto>
--depend DEPEND dependencies(separated by / (forward slash))
--obj OBJ the account used to run the service
(default=LocalSystem)
--password PASSWORD password of the account
--failure-reset FAILURE_RESET
specifies the length of the period (in seconds) with
no failures after which the failure count should be
reset to 0 (zero).
--failure-command FAILURE_COMMAND
specifies the command-line command to be run when the
specified service fails.
--failure-actions FAILURE_ACTIONS
specifies one or more failure actions and their delay
times (in milliseconds), separated by a forward slash
(/). Valid actions are run, restart, and reboot.
When using --arguments, make sure you added a double quote around it. Here are some examples:
- Create a service named
service1with command linepython test.py log.txt.
srvwrapper service1 python --arguments "test.py log.txt"
- Use absolute program path to create a service.
srvwrapper service2 C:\Python36\python.exe --arguments "\\\"D:\test 1\test.py\\\"" --display "Service 2" --description "A description" --start auto
- Use specific account.
srvwrapper service3 ping --arguments "-t github.com" --obj "NT AUTHORITY\NetworkService" --depend service2/service1
Step 3:
To start/stop the service, use the net command
net start service_name
net stop service_name
Uninstall
Use Windows sc command.
sc delete ServiceName
Metadata
Release files for srvwrapper 1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| srvwrapper-1.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for srvwrapper-1.5-py2.py3-none-any.whl |
Release files / srvwrapper-1.5-py2.py3-none-any.whl
| Download URL | srvwrapper-1.5-py2.py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a383b4c2917776e6f9c0ddb7ddf92a6e43b0f042ae0d0643ff975bec92c7fed3
|
|
BLAKE2b-256 checksum How to use checksums |
a295c525b350d7a31e46fbe770c88add22c20498e83c12c302e999f644cfcc6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
|
Security for srvwrapper 1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.