I have a .bat file that will start some servers and running that bat with a simple double click works just fine.

      Running the same bat file from Jenkins will start the execution but will produce some errors due to console input problems on that .exe file called from batch.

      It should be no difference between those 2 ways of running batch files...

      13:38:54 ${SOME_PATH}>shared\api\ServerManagerClient.exe /wait:5 /serverManager:localhost:7764 /command:addServer /gn:OrderBook /sn:ManualAdapter /in:TS_ManualAdapter /pcu:file:/${SOME_PATH_2} /wd:${SOME_PATH_3}
      13:38:54 Error executing command 'addServer'
      13:38:54 Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek.

          [JENKINS-24462] Running a batch command failure

          Daniel Beck added a comment -

          This is not a Jenkins bug. Your program seems to require an interactive session or needs to be called in an interactive cmd, which is not the case in Jenkins.

          To get assistance (e.g. workarounds, how to configure Jenkins so this works, if possible), please ask on the jenkinsci-users mailing list, or in #jenkins on Freenode.

          Daniel Beck added a comment - This is not a Jenkins bug. Your program seems to require an interactive session or needs to be called in an interactive cmd, which is not the case in Jenkins. To get assistance (e.g. workarounds, how to configure Jenkins so this works, if possible), please ask on the jenkinsci-users mailing list, or in #jenkins on Freenode.

          ilie daniel added a comment -

          Well, I'm not able to understand how this exe is an interactive one because all I do from windows is a double click. No input chars from me...

          Right now, I try to implement a workaround that will spawn a cmd.exe with proper arguments:
          <target name="runBat">
          <exec executable="cmd.exe" spawn="yes">
          <env key="BUILD_ID" value="dontKillMe" />
          <arg line="/c start cmd.exe /k call ${bat.file}" />
          </exec>
          </target>

          Why is not possible to emulate the run of a bat file as from windows

          ilie daniel added a comment - Well, I'm not able to understand how this exe is an interactive one because all I do from windows is a double click. No input chars from me... Right now, I try to implement a workaround that will spawn a cmd.exe with proper arguments: <target name="runBat"> <exec executable="cmd.exe" spawn="yes"> <env key="BUILD_ID" value="dontKillMe" /> <arg line="/c start cmd.exe /k call ${bat.file}" /> </exec> </target> Why is not possible to emulate the run of a bat file as from windows

          Daniel Beck added a comment -

          Well, I'm not able to understand how this exe is an interactive one because all I do from windows is a double click. No input chars from me...

          The following message is provided by the application you're trying to start, not by Jenkins, so it's clear it's the application's problem.

          Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek

          See e.g. http://stackoverflow.com/questions/3961542/checking-standard-input-in-c-sharp for ways to make the application tolerate non-interactive execution.

          Seriously, this is Not a Defect in Jenkins.

          Daniel Beck added a comment - Well, I'm not able to understand how this exe is an interactive one because all I do from windows is a double click. No input chars from me... The following message is provided by the application you're trying to start, not by Jenkins, so it's clear it's the application's problem. Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek See e.g. http://stackoverflow.com/questions/3961542/checking-standard-input-in-c-sharp for ways to make the application tolerate non-interactive execution. Seriously, this is Not a Defect in Jenkins.

          ilie daniel added a comment -

          Well, I have no access at the .exe source code...
          Assuming that this is not a defect, it's possible to emulate that behavior somehow? (enhancement)

          ilie daniel added a comment - Well, I have no access at the .exe source code... Assuming that this is not a defect, it's possible to emulate that behavior somehow? (enhancement)

          Oleg Nenashev added a comment -

          Jenkins has no wrappers for the automation of interactive operations.
          You can use third-party apps for such purpose (just google it)

          Oleg Nenashev added a comment - Jenkins has no wrappers for the automation of interactive operations. You can use third-party apps for such purpose (just google it)

            Unassigned Unassigned
            biriuck ilie daniel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: