Unable to execute a windows batch command in Jenkins Build

3,144 views
Skip to first unread message

Kofi Boateng

unread,
Oct 4, 2016, 9:55:51 AM10/4/16
to Jenkins Users
Hi,

I have installed Jenkins on my windows E drive. I created a Jenkins job to run the following command. The command is to run a windows executable from my windows C drive. However, the status of the run is Failed. Any help to fix the failure would be much appreciated.

call "C:\Program Files\PeopleSoft\PeopleSoft Test Framework\PsTestFw.exe" -CD=HCMTST1 -CO=username -CP=password -TST=PYR -TC=PSQUARYNAME  -EXO=HCMTST1 -LOG="S:\Users\Kofi.Boateng\ptf_log2.txt"

First, is the above syntax correct? I am not familiar with batch scripting so I am not sure if I need any escape sequence or quotes in the absolute path to the .exe as there are spaces in some of the folder names. 

Second, do I have environmental variable issue here? Jenkins is on E drive which is trying to execute a program on C drive and writing to a file on S drive all on one windows machine. 

Regards,

Kofi Boateng

Slide

unread,
Oct 4, 2016, 10:20:50 AM10/4/16
to Jenkins Users
Is Jenkins running as your user? If not, then it probably won't have access to S:\Users\Kofi.Boateng. You would probably want to put the log in the workspace of the job LOG="%WORKSPACE%\ptf_log2.txt" 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a5e3b33a-0aca-46a7-972e-eef651e2f65d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jer...@bodycad.com

unread,
Oct 4, 2016, 2:37:02 PM10/4/16
to Jenkins Users
Like stated by slide, the drive is not accessible by Jenkins like most services doesn't see the same drive letter as user. I would recommend add crendential into Windows credential manager and use absolute machine path where the share is access:
\\10.1.10.66\Share\MyPath

You can also use the following variables if you log error into the jenkins home folder
"${env.JENKINS_HOME}\\log\\ptf_log2.txt"

Only use local drive or use the full remote path as above to avoid problems with remote drive letter.

Kofi Boateng

unread,
Oct 4, 2016, 6:36:19 PM10/4/16
to Jenkins Users
I have updated the S drive thank you both (Slide and Jer). 

I need to explain that the reason why I have to call the executable this way by stating the drive letter is because the executable is a PeopleSoft Test Framework that I am calling to login to playback a recorded test script. So, moving the executable to the same E drive where Jenkins is would not work I think. 
Reply all
Reply to author
Forward
0 new messages