Re: Executing .exe on a remote Windows machine

Discussion in 'Python' started by Tim Golden, Nov 8, 2012.

  1. Tim Golden

    Tim Golden Guest

    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
     
    Tim Golden, Nov 8, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UmVzaG1hIFByYWJodQ==?=

    Auto-attach to process '[1084] aspnet_wp.exe' on machine <Machine

    =?Utf-8?B?UmVzaG1hIFByYWJodQ==?=, Jan 21, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,059
    =?Utf-8?B?UmVzaG1hIFByYWJodQ==?=
    Jan 21, 2005
  2. gaurav tyagi
    Replies:
    1
    Views:
    768
    bruce barker \(sqlwork.com\)
    Jun 19, 2006
  3. Tim Chandler
    Replies:
    0
    Views:
    218
    Tim Chandler
    Oct 7, 2003
  4. Replies:
    10
    Views:
    197
  5. Tim Golden
    Replies:
    0
    Views:
    137
    Tim Golden
    Nov 8, 2012
Loading...

Share This Page