{"id":25411703,"url":"https://github.com/koho/srvwrapper","last_synced_at":"2025-10-31T05:30:26.001Z","repository":{"id":57470774,"uuid":"197938434","full_name":"koho/srvwrapper","owner":"koho","description":"Create Windows service from executable","archived":false,"fork":false,"pushed_at":"2020-06-03T08:13:21.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T11:48:31.830Z","etag":null,"topics":["py2exe","python","win32service"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-20T14:06:17.000Z","updated_at":"2021-01-29T08:57:57.000Z","dependencies_parsed_at":"2022-09-26T17:40:36.980Z","dependency_job_id":null,"html_url":"https://github.com/koho/srvwrapper","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fsrvwrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fsrvwrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fsrvwrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koho%2Fsrvwrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koho","download_url":"https://codeload.github.com/koho/srvwrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239114328,"owners_count":19583999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["py2exe","python","win32service"],"created_at":"2025-02-16T10:19:19.600Z","updated_at":"2025-10-31T05:30:20.723Z","avatar_url":"https://github.com/koho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# srvwrapper\r\nCreate Windows service from executable\r\n\r\n## Install\r\n### Step 1:\r\nDownload and install the `srvwrapper` package for python.\r\n```\r\npip install srvwrapper\r\n```\r\n### Step 2:\r\nUse the `srvwrapper` command and pass the service name and program path to create a service. Other optional commands are listed with the `--help` command.\r\n```\r\nusage: srvwrapper [-h] [--arguments ARGUMENTS] [--display DISPLAY]\r\n                  [--description DESCRIPTION] [--start START]\r\n                  [--depend DEPEND] [--obj OBJ] [--password PASSWORD]\r\n                  name program\r\n\r\nWrap any applications to run as Windows Service\r\n\r\npositional arguments:\r\n  name                  service name\r\n  program               application path\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  --arguments ARGUMENTS\r\n                        arguments for program\r\n  --display DISPLAY     the display name of the service\r\n  --description DESCRIPTION\r\n                        service description\r\n  --start START         how the service starts\r\n                        \u003cboot|system|auto|demand|disabled|delayed-auto\u003e\r\n  --depend DEPEND       dependencies(separated by / (forward slash))\r\n  --obj OBJ             the account used to run the service\r\n                        (default=LocalSystem)\r\n  --password PASSWORD   password of the account\r\n  --failure-reset FAILURE_RESET\r\n                        specifies the length of the period (in seconds) with\r\n                        no failures after which the failure count should be\r\n                        reset to 0 (zero).\r\n  --failure-command FAILURE_COMMAND\r\n                        specifies the command-line command to be run when the\r\n                        specified service fails.\r\n  --failure-actions FAILURE_ACTIONS\r\n                        specifies one or more failure actions and their delay\r\n                        times (in milliseconds), separated by a forward slash\r\n                        (/). Valid actions are run, restart, and reboot.\r\n```\r\nWhen using `--arguments`, make sure you added a double quote around it. Here are some examples:\r\n1. Create a service named `service1` with command line `python test.py log.txt`.\r\n```cmd\r\nsrvwrapper service1 python --arguments \"test.py log.txt\"\r\n```\r\n2. Use absolute program path to create a service.\r\n```cmd\r\nsrvwrapper service2 C:\\Python36\\python.exe --arguments \"\\\\\\\"D:\\test 1\\test.py\\\\\\\"\" --display \"Service 2\" --description \"A description\" --start auto\r\n```\r\n3. Use specific account.\r\n```cmd\r\nsrvwrapper service3 ping --arguments \"-t github.com\" --obj \"NT AUTHORITY\\NetworkService\" --depend service2/service1\r\n```\r\n\r\n### Step 3:\r\nTo start/stop the service, use the `net` command\r\n```cmd\r\nnet start service_name\r\nnet stop service_name\r\n```\r\n\r\n\r\n## Uninstall\r\nUse Windows `sc` command.\r\n```\r\nsc delete ServiceName\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoho%2Fsrvwrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoho%2Fsrvwrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoho%2Fsrvwrapper/lists"}