Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Executing .exe on a remote Windows machine

Reply
Thread Tools

Re: Executing .exe on a remote Windows machine

 
 
Tim Golden
Guest
Posts: n/a
 
      11-08-2012
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"])
>
>
> & 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Executing .exe on a remote Windows machine Tim Golden Python 0 11-08-2012 02:31 PM
Passing arguments to & executing, a python script on a remote machinefrom a python script on local machine (using ssh ?) ashish Python 5 09-20-2012 05:45 PM
Passing arguments to & executing, a python script on a remote machinefrom a python script on local machine ashish Python 4 09-20-2012 07:28 AM
executing VIM on a remote machine? gianmh@gmail.com Ruby 10 11-02-2007 03:38 PM



Advertisments