-1

I attempted to execute the following command in a Jenkins batch script to run the executable named "GitFetcher.Exe," which is located within the tools directory of "IB.SO.AutoUtility."

dotnet tool install dotnet-ef --global
dotnet tool install IB.SO.AutoUtility --add-source "https://nexus.internal.com/repository/my-development/" --version 1.0.7 --global
GitFetcher

Unfortunately, it was running perfectly on my machine. However, when I execute this command in a Windows batch script within Jenkins, it produces an error stating that GitFetcher is not recognized as an internal or external command in the Jenkins console.

Could someone please provide the correct method to run an executable within Jenkins?

3
  • Maybe specify the full path to the binary? Change the "batch script " to output your environment and you'll see the path to binary is not in %PATH% variable. Commented Nov 4 at 7:03
  • The folder path containing the executable or script file with name GitFetcher is most likely added to system or user environment variable Path but not to the local environment variable PATH of the running cmd.exe process. The Windows Command Processor cannot find a file with name GitFetcher for that reason. If you know where GitFetcher is installed by default using the standard installation, reference the file GitFetcher in the batch file with its fully qualified file name, i.e. drive + path + name + extension enclosed all in ". Commented Nov 4 at 7:29
  • Please take a look on What is the reason for "X is not recognized as an internal or external command, operable program or batch file"? This long answer explains in full details how the environment variable PATH is managed on Windows and how cmd.exe uses it to find executables and script files specified in a batch file or by a user with just its file name without full path and without file extension. Commented Nov 4 at 7:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.