pypsexec
pypsexec copied to clipboard
remove_service throw exception
Hi, Jordan: thank you very much for the pypsexec package.
when I ran the sample code, it seemed like the connection, execution on the windows side were all working, however remove_service throw an exception:
Traceback (most recent call last):
File "towin_test.py", line 36, in
any insights would be much appreciated!
Looks like we need to better handle removing a process that is already marked for deletion. I'll try to find some time to fix this up but currently juggling a few other things right now. For now you can just catch and ignore that exception with something like.
from pypsexec.exception import SCMRException
try:
c.remove_service()
except SCMRException as exc:
if exc.return_code == 1072: # ERROR_SERVICE_MARKED_FOR_DELETE
pass
else:
raise
Gives the following error
Traceback (most recent call last):
File "cwin.py", line 2, in
Gives the following error
Traceback (most recent call last): File "cwin.py", line 2, in from pypsexec.exception import SCMRException ImportError: No module named exception
The module is name exceptions so "from pypsexec.exceptions import SCMRException" should work