(OS: Windows 7)
Using SC.EXE I have created a Windows Service. Additionally, I created the necessary registry entries to specify the Application path (using key Parameters).
The "Application" is a .BAT file that sets several environment variables and then calls a Python script. When running the .BAT file directly from within CMD I get normal, desired behavior.
Using the Service Manager I can start and stop the service (works also with SC.EXE directly issued from CMD). All that is ok, no warning or errors or anything else to be seen (in Event Log).
The BAT file does not get executed. I double checked the Application path, double checked the service name.
BAT file contents:
@ECHO OFF
REM ==========================================================================
REM ProcessIntergrationBridge Microsoft Windows Service Shell Script
REM ==========================================================================
SET CONSEQUOR_PIB_HOME=C:\opt\consequor\pib
SET CONSEQUOR_PIB_VERSION_DESIGNATOR=pib_b0100
SET CONSEQUOR_PIB_DATA=C:\var\opt\consequor\pib
SET CONSEQUOR_PIB_LOG=C:\var\opt\consequor\pib\log
SET CONSEQUOR_PIB_LOG_FILE=C:\var\opt\consequor\pib\log\pib.log
SET PYTHONPATH=C:\opt\consequor\pib\%CONSEQUOR_PIB_VERSION_DESIGNATOR%
SET PYTHONHOME=C:\opt\consequor\pib\python-runtime\win
SET PATH=%CONSEQUOR_PIB_HOME%\%CONSEQUOR_PIB_VERSION_DESIGNATOR%\bin;%CONSEQUOR_PIB_HOME%\python-runtime\win;CONSEQUOR_PIB_HOME%\python-runtime\win\DLLs;CONSEQUOR_PIB_HOME%\python-runtime\win\libs;CONSEQUOR_PIB_HOME%\python-runtime\win\Lib;%PATH%
SET CMD=%PYTHONHOME%\pythonw.exe %CONSEQUOR_PIB_HOME%\%CONSEQUOR_PIB_VERSION_DESIGNATOR%\%CONSEQUOR_PIB_VERSION_DESIGNATOR%\start_pib\pib_run_server.py debug
%CMD%
PIBD Service Registry entries: (Oh Merde Alors - I can't post pictures yet... - If someone wants to see then I can send via direct email ...)
Thank you for any hint on how to debug this, fix it, change it - You know.
Kind regards
Frank - having spent days now trying to understand Windows mysteries.
I recommend this approach:
But looking at the "SET PATH=" line, I see that some of the variables are not expressed properly (the leading % is missing on CONSEQUOR_PIB_HOME and others) which may be the issue...