1

I see that there is a 'shell()' equivalent in groovy script for 'Execute shell command' option in Job UI. What is the equivalent for 'Execute a Windows Batch command'?

P.S. Not looking for :

def process='xxxx'.execute()as it does not work on the slave I am triggering on. Any alternatives?

Ronak Agrawal
  • 1,006
  • 1
  • 19
  • 48

1 Answers1

2

Major dupe, but just in case someone trips over this one first...

any windows batch file cannot be run directly, pass it to cmd.exe with the /k or /c switch (iirc)

something like "cmd.exe /c myBatchFile.bat".execute()

Bill K
  • 62,186
  • 18
  • 105
  • 157