GitLab-runner is not recognized as an internal or external command, operable program, or batch file

GitLab Runner is open-source and written in Go. It can be run as a single binary; no language-specific requirements are needed. GitLab Runner can also run inside a Docker container or be deployed into a Kubernetes cluster. After you install the application, you register individual runners. Runners are the agents that run the CI/CD jobs that come from GitLab. When you register a runner, you are setting up communication between your GitLab instance and the machine where GitLab Runner is installed. Here are some related guides: How to install Git on macOS, How to uninstall Git on macOS, Practical Git use with mackdown, how to clone a repository and install software from GitHub on Windows, how to use AWS CodeCommit, Azure DevOps, and GitHub integration for Docker and Kubernetes deployment, and how to build your first CI/CD Pipeline in Azure DevOps using ASP.Net Core Application.
Runners usually process jobs on the same machine where you installed GitLab Runner. However, you can also have a runner process jobs in a container, in a Kubernetes cluster, or in auto-scaled instances in the cloud. See this guide on how to install, register and start GitLab Runner on Windows.
Unconventional Causes: GitLab-runner is not recognized
This issue is often associated with the environmental variable not defined, etc. Nonetheless, in this case, it has nothing to do with it. Below are some guides relating to Environment variables in Windows 10, Windows Error “Not recognized as an internal or external program” – Environment Variable, and how to uninstall Oracle Database 11G or 12c.
After spending some time troubleshooting this error, I decided to view the file name extension. Consequently, This led to the resolution of the issue.
-Similarly, Remember in the GitLab-Runner guide, you are optionally required to rename this file as “GitLab-runner.exe”. If you do not display the filename extenstion, you willautomatically be adding another .exe extensio to it : )
As you can see below, displaying the File name extension revealed the root cause.
In addition, We will have to rename it by deleting the .exe from the file name. What we should have left should be just "GitLab-runner.exe"
However, Upon taking the extra extension off the “GitLan-runner.exe,” you should be able to determine that “GitLab-runner is not recognized” as a command and run it without adding the .exe to it, as shown below. Moreover, You may want to see this related guide “Panic: Failed to register the GitLab-runner, you may be having network issues“.
I hope you found this blog post helpful. Furthermore, If you’re facing issues like GitLab-runner is not recognized, please let me know in the comment session.




