Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'restarting': 0.07; 'subject:Windows': 0.09; 'python': 0.09; '(although': 0.09; 'modifies': 0.09; 'cc:addr:python-list': 0.10; 'passing': 0.15; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'machine?': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'subprocess': 0.16; 'tjg': 0.16; 'wmi': 0.16; 'wrote:': 0.17; 'config': 0.17; 'trying': 0.21; 'software.': 0.21; 'either.': 0.22; 'cc:2**0': 0.23; 'changes,': 0.23; 'kevin': 0.23; 'machine': 0.24; 'script': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'wrote': 0.26; 'restart': 0.29; 'usually': 0.30; 'running': 0.32; 'limitations': 0.33; 'received:192.168.100': 0.33; 'subject: .': 0.33; 'acceptable': 0.35; 'machines': 0.35; 'remote': 0.35; 'there': 0.35; 'but': 0.36; 'execute': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'some': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'services': 0.64; 'making': 0.64; 'from:addr:mail': 0.71; 'to:none': 0.93 Date: Thu, 08 Nov 2012 14:31:31 +0000 From: Tim Golden User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 CC: "python-list@python.org" Subject: Re: Executing .exe on a remote Windows machine References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352385155 news.xs4all.nl 6955 [2001:888:2000:d::a6]:60364 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32954 On 08/11/2012 14:25, Kevin Holleran wrote: > Good morning, > > I wrote a python script to connect out to a bunch of my remote machines > that are running some software. It modifies a bunch of the config files > for me. After making the changes, I need to restart the software. The > way to do this is to call an .exe passing in a argument 'restart' > Simply restarting services is NOT acceptable & rebooting the machine > isn't either. > > I was trying to find a way to simply call the .exe on the remote machine > with subprocess but how can I get it to execute on the remote machine? > These machines do not have SSH. WMI can usually help with this (although there are limitations on what you can execute via WMI). Also people recommend sysinternals' psexec. (I've never tried it myself). TJG