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


Groups > comp.lang.python > #32959

Re: Executing .exe on a remote Windows machine

Date 2012-11-08 16:21 +0000
From Tim Golden <mail@timgolden.me.uk>
Subject Re: Executing .exe on a remote Windows machine
References <CAN4UfGzv8VepcwFTgYwbVwBPKg6W9LBEyUtLr3Wytp-f7KanQw@mail.gmail.com> <509BC243.6040407@timgolden.me.uk> <CAN4UfGyHTPXmDAr8LNH3PMK8-PWMXR1O9zZSNkePcjFWAEcWMQ@mail.gmail.com> <CAN4UfGxo5ZKUrvNtWL9nz8=fugtn07=jL1N+8E1_+oE50T=VSg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3446.1352391703.27098.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web