Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32959 > unrolled thread

Re: Executing .exe on a remote Windows machine

Started byTim Golden <mail@timgolden.me.uk>
First post2012-11-08 16:21 +0000
Last post2012-11-08 16:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Executing .exe on a remote Windows machine Tim Golden <mail@timgolden.me.uk> - 2012-11-08 16:21 +0000

#32959 — Re: Executing .exe on a remote Windows machine

FromTim Golden <mail@timgolden.me.uk>
Date2012-11-08 16:21 +0000
SubjectRe: Executing .exe on a remote Windows machine
Message-ID<mailman.3446.1352391703.27098.python-list@python.org>
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 <http://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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web