Skip to main content

srvwrapper wraps any applications to run as Windows Service

Project description

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

When using --arguments, make sure you added a double quote around it. Here are some examples:

  1. Create a service named service1 with command line python test.py log.txt.
srvwrapper service1 python --arguments "test.py log.txt"
  1. 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
  1. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for srvwrapper, version 1.4
Filename, size File type Python version Upload date Hashes
Filename, size srvwrapper-1.4-py2.py3-none-win32.whl (11.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size srvwrapper-1.4-py2.py3-none-win_amd64.whl (11.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page