[python-win32] Executing a program on a remote machine

Mark Hammond mhammond at skippinet.com.au
Tue Jan 4 02:18:02 CET 2005


> What I would like to do is use WMI or some other means to execute a
> program from one system (ie system #1) which will remotely execute the
> same program on the other two systems (2 and 3), through an ethernet
> connection. To clarify, each system will physically contain
> it's own copy
> of the program to be executed.

One technique would be to use DCOM.  You would register a Python COM object
on each machine, then you could use win32com.client.DispatchEx() to invoke
and call it.  IIRC, the objects being registered will require a custom
clsctx which includes pythoncom.CLSCTX_REMOTE_SERVER. "Python Programming on
Win32" demonstrates how to do all this.

Another fairly reliable technique would be to install a service on each
machine, and use XMLRPC or some such to communicate.  This service could
then spawn child processes as each request came in, and would not rely on
having a user logged in.  Python provides most of the building blocks you
need if you are happy to roll your own.

Mark



More information about the Python-win32 mailing list