3

I have a batch file on my bamboo server, that starts another batch file on an remote computer trough PsExec. If I double click the batch file on the bamboo sever everything is working fine, the batch file on the remote computer starts and PsExec exites with error code 0.

But if I start bamboo then PsExec hangs itself and the batch file on the remote computer don't start.

C:\PsTools>PsExec.exe \\<remote server> -u <user> -p <password> -s -i "C:\batchfile.bat"

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

This is my output and where PsExec hangs.

I don't understand why it hangs only when bamboo starts the batch.

Hope someone can help me

Bali C
  • 30,582
  • 35
  • 123
  • 152
user846290
  • 147
  • 1
  • 2
  • 10

2 Answers2

1

[ Program output lost when passed through PsExec ] there's a bug in psexec and it does redirects correctly when is called by everything different by cmd. You have few more options to start a process on remote machine: 1. http://feldkir.ch/xcmd.htm - it cannot be run on localhost 2. WMIC - also cannot be used on localhost , when host and and user/pass are given 2. SCHTASKS

Community
  • 1
  • 1
npocmaka
  • 55,367
  • 18
  • 148
  • 187
0

This is an old question but maybe somebody has the same problem. The first time you run psexec an eula dialog is shown. In order to avoid bamboo hanging with this dialog you may try the argument \accepteula. For instance:

PsExec.exe \\<remote server> -u <user> -p <password> -s -i "C:\batchfile.bat" -accepteula
  • You also need to make sure your psexec is new enough to make use of this token. At first, mine was older, and it didn't work. Updated to latest, and all is ok now. – Eric Jul 18 '16 at 19:49