Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; 'host,': 0.07; 'nested': 0.07; 'try:': 0.07; 'subject:Windows': 0.09; 'filename,': 0.09; 'cc:addr:python-list': 0.10; 'skip:f 30': 0.15; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 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; 'wrote:': 0.17; 'trying': 0.21; 'cc:2**0': 0.23; 'kevin': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:[ 10': 0.26; 'label': 0.27; 'attempting': 0.29; 'remotely': 0.29; 'restart': 0.29; 'could': 0.32; 'quotes': 0.33; 'received:192.168.100': 0.33; 'subject: .': 0.33; '(c)': 0.33; 'execute': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'received:192': 0.39; 'skip:" 10': 0.40; 'received:192.168': 0.40; 'from:addr:mail': 0.71; 'lose': 0.71; 'forwarder': 0.91; 'to:none': 0.93 Date: Thu, 08 Nov 2012 16:21:40 +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: <509BC243.6040407@timgolden.me.uk> 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352391703 news.xs4all.nl 6951 [2001:888:2000:d::a6]:40035 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32959 On 08/11/2012 15:37, Kevin Holleran wrote: > [code] > try: > print("Attempting to restart Splunk...") > subprocess.call(["psexec", "\\\\" + host, "'c:\\Program > Files\\Splunk\\bin\\splunk.exe'", "restart"]) > [/code] > > & am getting: > > [output] > Attempting to restart Splunk... > > PsExec v1.98 - Execute processes remotely > Copyright (C) 2001-2010 Mark Russinovich > Sysinternals - www.sysinternals.com > > > PsExec could not start 'c:\Program Files\Splunk\bin\splunk.exe' restart > on [IP_ADDRESS]: > The filename, directory name, or volume label syntax is incorrect. > [/output] > > I am simply trying to restart the splunk forwarder instance.... > > Any thoughts?? Lose the nested quotes in the .exe path; subprocess will take care of that: subprocess.call(["psexec", "\\\\" + host, "c:\\Program Files\\Splunk\\bin\\splunk.exe", "restart"]) TJG