You are welcome.
First variant, WinNMP runs.
The command brings WinNMP to the foreground and immediately ends with the error message.
C:\Certbot>"C:\Program Files (x86)\Certbot\Python\python.exe" -c "import subprocess; subprocess.run(['powershell.exe', '-Command', 'D:/WinNMP/WinNMP.exe /s'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, universal_newlines=True)"
Exception in thread Thread-2:
Traceback (most recent call last):
File "threading.py", line 973, in _bootstrap_inner
File "threading.py", line 910, in run
File "subprocess.py", line 1479, in _readerthread
File "encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 138: character maps to <undefined>
First variant, WinNMP doesn't run.
The command starts WinNMP and then waits for WinNMP to close, then ends with the error message.
C:\Certbot>"C:\Program Files (x86)\Certbot\Python\python.exe" -c "import subprocess; subprocess.run(['powershell.exe', '-Command', 'D:/WinNMP/WinNMP.exe /s'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, universal_newlines=True)"
Exception in thread Thread-2:
Traceback (most recent call last):
File "threading.py", line 973, in _bootstrap_inner
File "threading.py", line 910, in run
File "subprocess.py", line 1479, in _readerthread
File "encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 138: character maps to <undefined>
Second variant, WinNMP runs.
The command brings WinNMP to the foreground and ends.
C:\Certbot>"C:\Program Files (x86)\Certbot\Python\python.exe" -c "import subprocess; subprocess.run(['powershell.exe', '-Command', 'D:/WinNMP/WinNMP.exe /s'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, universal_newlines=False)"
(no output)
Second variant, WinNMP doesn't run.
The command starts WinNMP and ends.
C:\Certbot>"C:\Program Files (x86)\Certbot\Python\python.exe" -c "import subprocess; subprocess.run(['powershell.exe', '-Command', 'D:/WinNMP/WinNMP.exe /s'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, universal_newlines=False)"
(no output)
That's easy. If certbot starts WinNMP when it's already running, a second instance of WinNMP is started, which sees that it's already running, brings the already running one to the foreground and exits again. The best way to run a program only once (single instance). Therefore, certbot does not have to wait because the program it started has already ended.
If WinNMP is not running, certbot starts the main program and has to wait for it to exit.
In Windows scripts, you can use an argument at the start command to specify whether it should wait for completion or continue executing. But I'm shure you know this.
If there's anything else I can do to help, just ask.