title: How to execute sh file from jenkins running on windows
body: <p>Cygwin installed in my windows and able to execute the sh file using cmd prompt.
  same Cygwin plugin has been installed in jenkins which also running in windows.
  I created a job in jenkins build step->execute shell command I am giving the command as <strong>sh /cygdrive/d/539707/data/getchanges/gymBuild.sh</strong> while executing the job I am facing below exception.</p>
  
  <p>NOTE 1: In Jenkins/configuration/ under shell I didn't mention any path</p>
  
  <blockquote>
    <p>workspace] $ sh -xe
    D:\539707\tomcat-7.0.12\temp\hudson4624102689815543789.sh FATAL:
    command execution failed java.io.IOException: Cannot run program "sh"
    (in directory "C:\Users\539707.jenkins\jobs\Test_Gym\workspace"):
    CreateProcess error=2, The system cannot find the file specified  at
    java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)  at
    hudson.Proc$LocalProc.(Proc.java:244)   at
    hudson.Proc$LocalProc.(Proc.java:216)   at
    hudson.Launcher$LocalLauncher.launch(Launcher.java:815)   at
    hudson.plugins.cygpath.CygpathLauncherDecorator$1.launch(CygpathLauncherDecorator.java:66)
      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:782)
      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:1738)  at
    hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)   at
    hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410) Caused by:
    java.io.IOException: CreateProcess error=2, The system cannot find the
    file specified    at java.lang.ProcessImpl.create(Native Method)  at
    java.lang.ProcessImpl.(ProcessImpl.java:385)    at
    java.lang.ProcessImpl.start(ProcessImpl.java:136)     at
    java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)  ... 16 more
    Build step 'Execute shell' marked build as failure</p>
    
    <p>Finished: FAILURE</p>
  </blockquote>
  
  <p>NOTE 2: In Jenkins/configuration/ under shell I mention C:\cygwin\bin\mintty.exe</p>
  
  <p>After that below is the output</p>
  
  <blockquote>
    <p>$ C:\cygwin\bin\cygpath -w C:\cygwin\bin\mintty.exe [workspace] $
    C:\cygwin\bin\mintty.exe -xe
    D:\539707\tomcat-7.0.12\temp\hudson4745164988293910592.sh
    /usr/bin/mintty: unknown option '-x' Try '--help' for more
    information. Build step 'Execute shell' marked build as failure</p>
    
    <p>Finished: FAILURE</p>
  </blockquote>
  
  <p>Kindly suggest How to execute sh file from jenkins running on windows</p>