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.