We have a Jenkins job that bring together test results and populates a text
file with the current build we are testing. The text file is on a shared
folder on the same machine that hosts our Jenkins environment. We have
another Jenkins job that uses this file and has a build step with the
following batch command:

cd C:\TestResults
IF EXIST Build.txt ( 
set /p Build=<Build.txt
echo [FOR_DESC] %Build:~0,-4%
)

The problem is, when i try to run this via Jenkins it doesn't work, and
gives the following output.
[FOR_DESC] ~0,-4

Meaning %Build% is empty. When i run this on our server manually by putting
the code into a .bat file or by command prompt, it works as expected. So I
can verify the text file is not empty, and the code works. Am I missing
something when I'm trying to run this from Jenkins?

Thanks.



--
View this message in context: 
http://jenkins.361315.n4.nabble.com/Batch-script-runs-on-server-but-not-via-Jenkins-tp4660923.html
Sent from the Jenkins issues mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to