0

I downloaded gitlab-runner.exe file and need to share this file for accessories from any place on the disk.

So, I created an environment variable, using UI:

enter image description here

Also, I created an environment, using CLI:

set gitlab-runnner=d:\GitlubRunner\gitlab-runner.exe

But I still can't accept the gitlab-runner.exe from the other folder. Now is available for me only:

%GitLab_Runner%
%gitlab-runner%

enter image description here

  • Neet to add: the environment that I created by CLI (%gitlab-runner%) not works after rebooting
  • 1
    Is it spelled `girlab`, `gitlub`, or `gitlab`? Is it written with a `-` or with a `_`? – u1686_grawity Nov 26 '20 at 15:44
  • After you added the variable did you reboot? That is required when you modify the system variables. Simply closing the command prompt would/should refresh the user variables. Why are you adding both user and system variables to the same path? **The fact `%gitlub-runner%` works, means your system environmental variable is working, you should edit your question and clarify your question.** – Ramhound Nov 26 '20 at 15:44
  • @user1686 Sorry, updated – Valentyn Hruzytskyi Nov 26 '20 at 15:48
  • @Ramhound The question is updated – Valentyn Hruzytskyi Nov 26 '20 at 15:49
  • @ValentynHruzytskyi - I will again point out the fact `%gitlab-runner%` actually works means the variable is configured. Have you performed a reboot? You don't actually need two variables, the single user environmental variable, is more than enough. The reason you are unable to launch `gitlab-runner.exe` from any location is due to the fact your PATH variable hasn't been updated. – Ramhound Nov 26 '20 at 15:50
  • You need to add it to your path as well ... – DavidPostill Nov 26 '20 at 15:51
  • Does this answer your question? [What are PATH and other environment variables, and how can I set or use them?](https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them) – Scott - Слава Україні Nov 26 '20 at 18:17

1 Answers1

1

But I still can't accept the GitLab-runner.exe from the other folder.

You need to update the PATH system environment variable to include a path to this executable. You indicated that %gitlab_runner% is working, which is an indication, your system variable GITLAB_RUNNER system variable is configured properly.

However, you have a conflicting system variable that should be removed, it's necessary to define GITLUB_RUNNER as a user and system variable. You really should delete both of those system variables, and only create user system variables, unless this machine is used by multiple users. If that is the case, then the user variables should be deleted, and only the system variables used.

You can still create a user variable GITLAB_RUNNER so you can use %GITLAB_RUNNER% in a script to execute the executable.

Need to add: the environment that I created by CLI (%gitlab-runner%) not works after rebooting

You have not made a GITLAB-RUNNER environmental variable. So %gitlab-runner% won't work until you do. However, the reason your unable to launch GitLab-runner.exe from any directory is due to the PATH variable still not containing a the not being updated to include d:\GitlubRunner\

Ramhound
  • 41,734
  • 35
  • 103
  • 130
  • Sorry, but `%gitlab_runner%` doesn't work after rebooting...`gitlab-runner` also – Valentyn Hruzytskyi Nov 26 '20 at 16:09
  • @ValentynHruzytskyi - Except indicated it was working in your question. I presumed `%gitlab-runner%` was actually supposed to be `%gitlab_runner%` due to your previous and numerous typographical mistakes. – Ramhound Nov 26 '20 at 16:10
  • But %GITLAB_RUNNER% works fine... – Valentyn Hruzytskyi Nov 26 '20 at 16:10
  • 1
    @ValentynHruzytskyi - **You don't have a system variable named `gitlab-runner` only `gitlab_runner`** Please fix your screenshot to reflect the actual state of your system currently. I am willing to update my answer, but due to the numerous typographical mistakes it impossible to tell what variables actually exist currently. – Ramhound Nov 26 '20 at 16:12