Change Environment Variables HOME in Windows to not have an semicolon

61 Views Asked by At

I have kind of an weird problem. I cant access my HOME directory in Git Bash or CMD using cd ~ or cd. I set the Enviroment Variable to C/Users/274338 but it somehow registers as C/Users/274338;. Also it was working before and i cant recall changing anything. How can i change that?

using cd in git bash Enviroment Variable

Using cd ~ i expected to go to my set Home directory. I tried changing the variable but to my knowledge it was correct. The directory is existing as can be seen in my image.

1

There are 1 best solutions below

2
nazDridoy On

modify C:\Program Files (x86)\Git\etc\profile and set $HOME variable to your HOME.

HOME="/c/Users/274338"

Save and open Git Bash and execute cd ~. You should be in /C/Users/274338

EDIT: To change the HOME environment variable in Windows

  • Click the Start button, type "environment properties" into the search bar
  • In the System Properties window, click "Environment Variables."
  • Under "User variables" or "System variables" (depending on whether you want to change the variable for the current user or all users), find the HOME variable.
  • Click "Edit" to change the value of the HOME variable.
  • Enter the new path for the HOME variable and click "OK" to save the changes.
  • Click "OK" again to close the Environment Variables window