79473949

Date: 2025-02-27 21:17:42
Score: 1
Natty:
Report link

I'm earch in google next:

python win32serviceutil.HandleCommandLine() [SC] StartService FAILED 1053:The service did not respond to the start or control request in a timely fashion.

Helped links:

Solution

I Step

Launched the console as an administrator

Installed pywin32 globally and locally within the project (.venv).

pip install pywin32

Then check installed package in C:\Python\Python313\Lib\site-packages

II Step

From C:\Python\Python313\Scripts run

python C:\Python\Python313\Scripts\pywin32_postinstall.py -install

III Step

Go to own python project with service

C:\Users\Projects\services>python win_service2.py --startup=auto install

This command displayed

Installing service MyWinSrv2
moving host exe 'C:\Python\Python313\Lib\site-packages\win32\pythonservice.exe' -> 'C:\Python\Python313\pythonservice.exe'
copying helper dll 'C:\Python\Python313\Lib\site-packages\pywin32_system32\pywintypes313.dll' -> 'C:\Python\Python313\pywintypes313.dll'
Service installed

That's it!

Service commands

python win_service2.py --startup=auto install
python win_service2.py start
python win_service2.py stop
python win_service2.py remove
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Andrey Kogut