We have a windows bat script that works fine in windows. When run under Jenkins we have to run the embedded program in quoted string this causes the output to only be seen till after completion of the command. When run in a real windows cmd.exe the output come out when the text is found continues to run. We see the program is in the path directory and we also add the path statement before execution. "C:\MyPrograms\;%path%". What causes Jenkins to save the output till after execution completes and why does the program have to be quoted when the program is in the path? We are using SVN | Grep and we get prorgam not found unless its is a quoted string with full path. "c:\Tortoise\Svn.exe parms | "C:\Myprogram\grep.exe" "string" " works with no output till the end. c:\Tortoise\Svn.exe parms | grep.exe "string" prorgam\command not found when the path is visibble in the echo "%path% command. Any ideas?Answer1:
How and more importantly <strong>when</strong> are you setting the path? As part of the job or as a separate step outside the job?
In any case, you wrote: <em>"C\MyPrograms\;%path%"</em><br />
First, I hope it is a typo on your part, but you need the colon (
Second, you set the path with a
set command, like so:<br />
Now the important part. Setting the path like this from command line is <strong>not permanent</strong> and will only last for the duration of this
cmd.exe session. So, if you are doing this as part of the job, then that's fine. But if you are doing it separately from command line, that is not permanent and not available when Jenkins runs.
You can permanently set the path for the system by following the answer here <a href="https://superuser.com/questions/317631/setting-path-in-windows-7-command-prompt" rel="nofollow">https://superuser.com/questions/317631/setting-path-in-windows-7-command-prompt</a>