Executing .exe on a remote Windows machine
mail at timgolden.me.uk
Thu Nov 8 17:21:40 CET 2012
On 08/11/2012 15:37, Kevin Holleran wrote:
> print("Attempting to restart Splunk...")
> subprocess.call(["psexec", "\\\\" + host, "'c:\\Program
> Files\\Splunk\\bin\\splunk.exe'", "restart"])
> & am getting:
> 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.
> 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
More information about the Python-list