Problem with build step - Windows Batch Command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with build step - Windows Batch Command

ssitaramasastri
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with build step - Windows Batch Command

Daniel Beck

> On 03.02.2017, at 05:39, [hidden email] wrote:
>
> 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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with build step - Windows Batch Command

ssitaramasastri
Hi,

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

Sitaram.

On Friday, February 3, 2017 at 1:51:18 AM UTC-6, Daniel Beck wrote:

> On 03.02.2017, at 05:39, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5Gv6X-1EDgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ssitara...@... wrote:
>
> 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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with build step - Windows Batch Command

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 [hidden email].
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.