title: Gocd task fails after shell script execution
body: <p>Running GOCD server on windows server and agent on windows 10. One of the tasks in a pipeline is running shell script in agent using custom command in GOCD task.</p>
  
  <p>As of now, shell script just has 1 line</p>
  
  <pre><code>echo "hello"
  </code></pre>
  
  <p>The script is executed fine when task is triggered, but the task fails in the pipeline console.</p>
  
  <p>Update :
  My config file for pipeline which triggers sh file. Content is same as above a single line echo command.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;cruise xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cruise-config.xsd" schemaVersion="106"&gt;
    &lt;server artifactsdir="artifacts" agentAutoRegisterKey="270fb4b6-d548-435b-a4b5-a6f6952e1a4d" webhookSecret="eba9b673-0757-4577-807d-82dca985d17f" commandRepositoryLocation="default" serverId="359f16bd-f9c9-4c52-bd78-081df4069961" tokenGenerationKey="82d73c79-47f7-494e-9ec7-76639d4ec961" /&gt;
    &lt;pipelines group="defaultGroup"&gt;
      &lt;pipeline name="test1"&gt;
        &lt;materials&gt;
          &lt;git url="http://infygit.ad.infosys.com/Mohit_Vora/InfyBankH2Dev.git" dest="codedev" /&gt;
        &lt;/materials&gt;
        &lt;stage name="defaultStage"&gt;
          &lt;jobs&gt;
            &lt;job name="defaultJob"&gt;
              &lt;tasks&gt;
                &lt;exec command="mvn clean install" workingdir="codedev"&gt;
                  &lt;runif status="passed" /&gt;
                &lt;/exec&gt;
              &lt;/tasks&gt;
              &lt;artifacts&gt;
                &lt;artifact type="build" src="codedev/target/*.war" dest="deployWar" /&gt;
                &lt;artifact type="build" src="codedev/tomcat.sh" dest="deployWar" /&gt;
                &lt;artifact type="build" src="codedev/tomcat.bat" dest="deployWar" /&gt;
              &lt;/artifacts&gt;
            &lt;/job&gt;
          &lt;/jobs&gt;
        &lt;/stage&gt;
      &lt;/pipeline&gt;
      &lt;pipeline name="test2"&gt;
        &lt;materials&gt;
          &lt;pipeline pipelineName="test1" stageName="defaultStage" /&gt;
        &lt;/materials&gt;
        &lt;stage name="defaultStage"&gt;
          &lt;jobs&gt;
            &lt;job name="defaultJob"&gt;
              &lt;tasks&gt;
                &lt;fetchartifact srcdir="deployWar" dest="warTestDeploy" pipeline="test1" stage="defaultStage" job="defaultJob"&gt;
                  &lt;runif status="passed" /&gt;
                &lt;/fetchartifact&gt;
                &lt;exec command="tomcat.sh" workingdir="warTestDeploy/deployWar"&gt;
                  &lt;runif status="passed" /&gt;
                &lt;/exec&gt;
              &lt;/tasks&gt;
            &lt;/job&gt;
          &lt;/jobs&gt;
        &lt;/stage&gt;
      &lt;/pipeline&gt;
    &lt;/pipelines&gt;
    &lt;agents&gt;
      &lt;agent hostname="MYSGEC241372D" ipaddress="10.123.75.196" uuid="37628ff5-91f7-4c9a-a5f5-615e937f2650" /&gt;
    &lt;/agents&gt;
  &lt;/cruise&gt;
  </code></pre>
  
  <p>My console log:</p>
  
  <pre><code>##|19:47:17.280 [go] Start to build test2/25/defaultStage/1/defaultJob on MYSGEC241372D [C:\Program Files\Go Agent]
  !!|19:47:17.280 [go] Task: fetch artifact [deployWar] =&gt; [warTestDeploy] from [test1/defaultStage/defaultJob]
  &amp;1|19:47:17.280 [go] Fetching artifact [deployWar] from [test1/13/defaultStage/1/defaultJob]
  &amp;1|19:47:26.211 [go] Saved artifact to [pipelines\test2\warTestDeploy] after verifying the integrity of its contents.
  ?0|19:47:26.211 [go] Task status: passed (8931 ms)
  !!|19:47:26.211 [go] Task: tomcat.sh
  ?1|19:49:06.044 [go] Task status: failed (99833 ms) (exit code: -1073741819)
  j1|19:49:06.122 [go] Current job status: failed
  ##|19:49:06.169 [go] Start to create properties test2/25/defaultStage/1/defaultJob on MYSGEC241372D [C:\Program Files\Go Agent]
  ar|19:49:06.169 [go] Start to upload test2/25/defaultStage/1/defaultJob on MYSGEC241372D [C:\Program Files\Go Agent]
  ex|19:49:06.274 [go] Job completed test2/25/defaultStage/1/defaultJob on MYSGEC241372D [C:\Program Files\Go Agent]
  </code></pre>