0

I've been stuck on this issue for the past 3 or 4 days. I am trying to run the attached command in a Windows batch file in Jenkins. This causes it to hang and it doesn't accept any further inputs:

knife winrm ec2-xx-xx-xx-xx.compute-1.amazonaws.com interactive -m -x Administrator -P xxxxxxxx

This works fine if run manually on a Windows machine, but I think the ruby.exe that is being opened is starting to cause Jenkins some problems.

Has anyone ever used knife winRM's interactive mode in such a way before? I'm at my wits end here and I really need this to work. Thank you for any help you could provide.

1 Answers1

0

Have you tried running it as "call knife" instead of just "knife"? If, inside a batch file, you run another batch file (knife.bat, for example) without "call", the initial batch file run is terminated. There's a good explanation here: http://www.robvanderwoude.com/call.php

cswarren
  • 1
  • 1
  • Yep, tried this and I still get the same issue. It will run the first knife command but if i have a second command in the same batch file, the second command is never run. – user3768815 Jun 26 '14 at 14:27
  • If the two knife commands are in separate "Execute Windows batch command" boxes, does that work? – cswarren Jun 27 '14 at 16:01