Python: run a process inside a windows host

て烟熏妆下的殇ゞ 提交于 2019-12-25 01:48:38

问题


I need to run a process inside a windows host from a linux host using python. I saw WMI python library but seems to work only from a windows host, not linux, how can I do? I neeed something like PSEXEC, but it works only for windows.


回答1:


An easy solution is to run a SSH server on the windows box and use the paramiko library on the client side.




回答2:


Since you cannot install anything on the windows host, does it have openoffice, or libreoffice installed? You coult then use the Python interpreter bundled with it to create a python script that listens to xmlrpc and get you job done, controling this script remotely.

If there is no Python installed on the windows side, and yur remote host is Linux, there is this recipe here: http://code.activestate.com/recipes/577945-execute-remote-commands-on-windows-like-psexec/ It does depend on windows - as it imports win32wnet - in my experience, these windows specific modules will run fine in a Windows python installed on a Wine configuration on a Linux machinne.



来源:https://stackoverflow.com/questions/10164351/python-run-a-process-inside-a-windows-host

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!