Try putting a -i in the psexec call.  i.e.

psexec -i \\<servername> <cmd_to_run>

Evidently it needs some sort of interactive privileges to run.  When 
looking on my target server I'm not seeing any specific windows pop up when 
I run it so I don't know if it actually needs to have a logged in console 
session on the target machine or not, but I was banging my head against a 
wall for several hours until I came across this solution that worked for 
someone else.

SA



On Thursday, July 19, 2012 3:25:06 AM UTC-5, Eyal wrote:
>
> I'm having the same problem? Any suggestions?
>
> On Wednesday, January 11, 2012 10:42:42 PM UTC+2, had4 wrote:
>>
>> I am running a Jenkins build on windows that calls a script from the 
>> workspace which uses psexec.exe to remotely run an installation on 
>> another server. I have the -accepteula option so it doesn't hang 
>> waiting for that. It actually runs the job on the remote server but 
>> when the remote script exits the Jenkins build doesn't get the message 
>> and hangs (until I kill the psexec service process on the remote 
>> server or the psexec process on the Jenkins server. Has anyone tried 
>> this successfully? Below is the output from the end of the jenkins job 
>> where it is running the script. 
>>
>> Is this something I should be using a Jenkins slave for? I suppose I 
>> should look into that. 
>>
>> Thanks. 
>>
>>
>> [workspace] $ cmd /c call D:\tomcat6\temp 
>> \hudson7618064618623105909.bat 
>>
>> d:\opt\hudson\jobs\Deploy XXX to Dev\workspace>installdevportal.bat 
>>
>> d:\opt\hudson\jobs\Deploy XXX to Dev\workspace>set SERVER=10.99.99.56 
>>
>> d:\opt\hudson\jobs\Deploy XXX to Dev\workspace>copy target\portal.war \ 
>> \10.217.6.56\D$\temp 
>>         1 file(s) copied. 
>>
>> d:\opt\hudson\jobs\Deploy XXX to Dev\workspace>tools\psexec.exe - 
>> accepteula \\10.99.99.56 -u techboss -p PASSWORD -w d:\temp d:\temp 
>> \installportal.bat 10.99.99.56 weblogic 
>>
>> PsExec v1.98 - Execute processes remotely 
>> Copyright (C) 2001-2010 Mark Russinovich 
>> Sysinternals - www.sysinternals.com 
>>
>> ---- HANGS HERE UNTIL I KILL PROCESSES, NO OUTPUT RETURNED FROM REMOTE 
>> SCRIPT 
>>
>> Build was aborted 
>> Aborted by hal.deadman 
>> Finished: ABORTED 
>>
>

Reply via email to