I'm using pypsexec to connect to a remote Windows machine. I've to find a list of files with a certain extension. This is what I'm doing right now.
command = "dir /b/s *.py"
client.run_executable("cmd.exe", arguments=f"/c {command}", asynchronous=True)
I wasn't receiving any responses at first when I didn't use the asynchronous parameter. Having read the documentation, I can see that long-running tasks (like mine) should use this parameter. However, it doesn't provide explicit instructions on how to get the output after the job is finished.
Thanks in advance!
This is because you can't get the output. See https://github.com/jborean93/pypsexec/blob/master/pypsexec/client.py#L436-L466
As you can see when using
asynchronous=Truethe stdout and stderr will always beNone