batch file is not an internal or external is not recognized as internal or external command

3,947 views
Skip to first unread message

Menos II

unread,
Oct 9, 2014, 11:00:16 AM10/9/14
to jenkins...@googlegroups.com

Hello,

I am trying to build a Delphi XE6 project. The source code is being pulled from two subversion folders. Inside one of these folders are a few .bat files that need to be run. I assigned these .bat files to be run on a build task. When trying to build the project everything goes fine until the build needs the execute the .bat files. I get the following error: [bat file] is not recognized as an internal or external command, operable program or batch file. I already tried adding the subversion and the Jenkins workspace directory to the Windows Path, but this has not fixed the problem. I also disabled UAC.
Hopefully someone can help me.

System information:
Windows 8.1
Jenkins 1.583
Google Chrome.

Rob Mandeville

unread,
Oct 9, 2014, 11:29:06 AM10/9/14
to jenkins...@googlegroups.com

How do you set the Windows path?  If you’re not setting it in the job itself, consider it suspect.  The PATH you get if you’re using the master node is the PATH that Jenkins launches with (is it set up as a service?).  If you’re using a slave node, you get the PATH that the slave launches with.

 

Either set the PATH in the Batch step that you are running the files in, or call them explicitly by path.  Remember that the batch step will run in the workspace directory, so you should be able to use a relative path.

 

--Rob

--
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.
For more options, visit https://groups.google.com/d/optout.

Click here to report this email as spam.



This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

Menos II

unread,
Oct 9, 2014, 11:34:57 AM10/9/14
to jenkins...@googlegroups.com, rmand...@dekaresearch.com
Thanks for the quick reply!

I set the path in system variables. I did not try calling it explicitly within the command. I'll try that first thing in the morning and update this thread with it's result.
So if I am correct I will need to call C:\Program Files(x86)\Jenkins\workspace\[buildname] batchfile.bat? Right now I only call the batch file without a path.

Op donderdag 9 oktober 2014 17:29:06 UTC+2 schreef Rob Mandeville:

Les Mikesell

unread,
Oct 9, 2014, 12:06:08 PM10/9/14
to jenkinsci-users, rmand...@dekaresearch.com
On Thu, Oct 9, 2014 at 10:34 AM, Menos II <menosth...@gmail.com> wrote:
> Thanks for the quick reply!
>
> I set the path in system variables. I did not try calling it explicitly
> within the command. I'll try that first thing in the morning and update this
> thread with it's result.
> So if I am correct I will need to call C:\Program
> Files(x86)\Jenkins\workspace\[buildname] batchfile.bat? Right now I only
> call the batch file without a path.

I thought you said the batch files would check out into a
subdirectory. Unless you explicitly change directories in the calling
build script, your working directory should be the (buildname). Using
a path relative to that would continue to work if you run it on a
slave with a different remote FS root location.

--
Les Mikesell
lesmi...@gmail.com

Menos II

unread,
Oct 10, 2014, 4:10:49 AM10/10/14
to jenkins...@googlegroups.com, rmand...@dekaresearch.com
The batch files are not in a subdirectory no. I did check the working directory when the error fires and the batch files it needs to run do not appear there. almost seems like the subversion folder is not being checked out correctly. I double checked everything and the build step "Execute Windows batch command" has the right batch file in it, I also checked the spelling. the subversion folder it checks out also has the batch file in it. I will still try the direct call with full file path (does not hurt to try right).

I also remember that Windows 8.1 does need cmd to run as admin for certain things to work. could this be the same issue here? If so, is there a way to let Jenkins run cmd as admin?

I am sorry if I am providing the wrong information here. This is my first time working with Jenkins and subversion. (I am a student intern at our company)

Op donderdag 9 oktober 2014 18:06:08 UTC+2 schreef LesMikesell:

Menos II

unread,
Oct 10, 2014, 5:57:12 AM10/10/14
to jenkins...@googlegroups.com, rmand...@dekaresearch.com
I did try the direct call with full path, I did not work, as I expected.
A little more info. I am not using a slave, just a Windows 8.1 Virtual Machine (which will later become a remote desktop on a server.)

Op vrijdag 10 oktober 2014 10:10:49 UTC+2 schreef Menos II:

Les Mikesell

unread,
Oct 10, 2014, 8:39:32 AM10/10/14
to jenkinsci-users, rmandeville
On Fri, Oct 10, 2014 at 3:10 AM, Menos II <menosth...@gmail.com> wrote:
> The batch files are not in a subdirectory no. I did check the working
> directory when the error fires and the batch files it needs to run do not
> appear there. almost seems like the subversion folder is not being checked
> out correctly. I double checked everything and the build step "Execute
> Windows batch command" has the right batch file in it, I also checked the
> spelling. the subversion folder it checks out also has the batch file in it.
> I will still try the direct call with full file path (does not hurt to try
> right).
>

Normally everything in the workspace would come from the jenkins
subversion checkout and appear the same as if you had done a manual
checkout. If the contents of the workspace are not what you expect,
you need to fix that first.

--
Les Mikesell
lesmi...@gmail.com

Menos II

unread,
Oct 10, 2014, 9:59:07 AM10/10/14
to jenkins...@googlegroups.com, rmand...@dekaresearch.com
I got it to work, I switched the two subversion folders in my configuration and that seemed to solve it. I run into different issues now but I will make a new post for that.

Thanks for the help!


Op vrijdag 10 oktober 2014 14:39:32 UTC+2 schreef LesMikesell:
Reply all
Reply to author
Forward
0 new messages