Discussion:
Problem with build step - Windows Batch Command
s***@gmail.com
2017-02-03 04:39:29 UTC
Permalink
Hi

I have setup Jenkins in Docker and am able to run some ANT script, I now
have to run some 'windows batch script'. I gave a basic command echo
"Hello" but I am getting the following error... I believe it is expecting
cmd.exe to be in my work space??? Can some one please help me resolve this
? Thanks in advance

[CI] $ cmd /c call /tmp/hudson5615964182226568321.bat
FATAL: command execution failed
java.io.IOException: Cannot run program "cmd" (in directory
"/var/jenkins_home/workspace/CI"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:243)
at hudson.Proc$LocalProc.<init>(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 15 more
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

Thanks.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5d9a8078-ec9e-43b4-9593-0e06b4c06948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniel Beck
2017-02-03 07:51:04 UTC
Permalink
I gave a basic command echo "Hello" but I am getting the following error... I believe it is expecting cmd.exe to be in my work space???
Windows batch scripts need to run on Windows nodes -- as you can see from the workspace path, it's a Linux system.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6F1A4D5E-7865-4562-9215-8600C2C6418B%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2017-02-03 20:33:40 UTC
Permalink
Hi,

I got you. Thank you so much for your help.

Sitaram.
I gave a basic command echo "Hello" but I am getting the following
error... I believe it is expecting cmd.exe to be in my work space???
Windows batch scripts need to run on Windows nodes -- as you can see from
the workspace path, it's a Linux system.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f75a48a4-3298-4da4-9709-b9df2d30e23c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
vikash singh
2017-12-20 16:12:29 UTC
Permalink
I am facing the same problem.
Can you tell me how did you resolve it.?
How can i change the workspace to run windows batch command.?
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c4f46e70-919f-4078-8a08-51c6ba9f1482%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jorge Nuñez
2018-10-30 16:02:43 UTC
Permalink
You have to looking in your Jenkins Job if youÂŽr using any step for
"windows" and change it to a "shell"

El miércoles, 20 de diciembre de 2017, 13:16:13 (UTC-3), vikash singh
I am facing the same problem.
Can you tell me how did you resolve it.?
How can i change the workspace to run windows batch command.?
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/93bffb42-4f94-4406-a518-65125b7f7bb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...