Python Forum
Python script running under windows over nssm.exe
Poll: Python script running under windows over nssm.exe
You do not have permission to vote in this poll.
nssm.exe
0%
0 0%
daemon
0%
0 0%
Total 0 vote(s) 0%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python script running under windows over nssm.exe
#1
I have a python script that runs inside this command:

subprocess.run([driver, '/print:printer=' + printer, filename])
If the script is run from the command line, everything works (the script is written as a daemon, ie it never ends and waits for data to arrive from the computer network). But if, for the same script, I create a daemon in windows services using nssm.exe, the script stops working. Respectively, the driver that processes the file cannot load its configuration, which is stored in the same directory where the script is in the python daemon, and the driver is also located there.

Can you advise what I need to modify so that the driver looking for its configuration file can find it when the configuration file is located in the same location as the driver? Do I need to modify the subprocess.run command somehow?

Here is the directory listing (C:\Python37):

PDFXCview.exe driver
PDF-XChange Viewer Settings.dat drivers configuration file
PrinterBirdge.ini configuratin file for daemon
PrinterBridge.py script daemon


PDFXCview.exe does support other parameters on the command line, but none of the parameters were able to force PDFXCview.exe to load the configuration file. However, only if the script runs as a windows service.

Thanks

Jaroslav


.py   PrinterBridge.py (Size: 3.1 KB / Downloads: 91)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  No Internet connection when running a Python script basil_555 8 662 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 520 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Triggering a ps1 script in remote windows server via http python request jasveerjassi 1 379 Jan-26-2024, 07:02 PM
Last Post: deanhystad
  Help Running Python Script in Mac OS emojistickers 0 351 Nov-20-2023, 01:58 PM
Last Post: emojistickers
  Trying to make a board with turtle, nothing happens when running script Quascia 3 682 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,277 Jun-29-2023, 11:57 AM
Last Post: gologica
  Running script with subprocess in another directory paul18fr 1 3,813 Jan-20-2023, 02:33 PM
Last Post: paul18fr
  How to compile a Python script for a Windows / Linux executable? netanelst 2 1,339 May-24-2022, 07:02 AM
Last Post: netanelst
  Setup Portable Python on Windows for script starts with double clicks? pstein 0 1,826 Feb-18-2022, 01:29 PM
Last Post: pstein
  batch file for running python scipt in Windows shell MaartenRo 2 1,901 Jan-21-2022, 02:36 PM
Last Post: MaartenRo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020