0

The situation: I am running psexec.exe from one windows machine to another and would like to run a python script on the remote machine and look at the output of the script without having to pipe it to a file and then read out the file, because the script is actually interactive and needs to have user input and display results back to the user for real time decisions. Running psexec in it's current form does not display anything when a python script is ran. example:
C:\Users\rweber\Desktop\PSEXEX>PsExec.exe \dcn0 -u administrator -p password C:\Python26\python.exe gives no stdin,stdout,stderr or access to the python console. It will just sit there until exited. Can this be fixed? How do you fix it?

3
  • ps... running python 2.6 on both. Apr 9, 2013 at 17:52
  • pps. piping the command to a batch file and then running it still does not give me the stdout/stderr of any python script let alone stdin for a script. Apr 9, 2013 at 18:07
  • PPPS. problem with psexec extends to other shell type interfaces that spawn another process. These processes are normally monitered by the cmd window that spawned them when ran locally, but running the cmd prompt remotely does not forward the stdout/err/in between the remote cmd window and the spawned process. other examples: perl, ssh. Apr 9, 2013 at 20:05

1 Answer 1

0

Trying to shell out to a poorly written solution that has lots of overhead is messy, hard, and not ideal. Utilizing the windows remote management suite is a much cleaner solution and native to python using the : https://github.com/diyan/pywinrm project.

IT'S MUCH CLEANER AND I AM MUCH HAPPIER WITH THE EASE OF RESULTS!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .