0

I recently changed the HOME variable to C:\ on my server. Today, I noticed an issue where a bat script that makes some GIT calls wouldn't run because a concatenated path was invalid due to the HOME variable's value being output as C:". I tried all of the below and nothing seemed to fix this:

> setx HOME C:\
SUCCESS: Specified value was saved.

> echo %HOME%
C:"

> setx HOME C:
SUCCESS: Specified value was saved.

> echo %HOME%
C:"

> setx HOME 'C:'
SUCCESS: Specified value was saved.

> echo %HOME%
C:"

> setx HOME "C:"
SUCCESS: Specified value was saved.

> echo %HOME%
C:"

> setx HOMEDRIVE C:
SUCCESS: Specified value was saved.

> echo %HOMEDRIVE%
C:

> setx HOME %HOMEDRIVE%
SUCCESS: Specified value was saved.

> echo %HOME%
C:"

> setx HOME HOMEDRIVE
SUCCESS: Specified value was saved.

> echo %HOME%
C:"    

> echo %HOMEDRIVE%
C:

> setx HOME %SYSTEMDRIVE%
SUCCESS: Specified value was saved.

> echo %HOME%
C:"    

I'm really not sure what I'm doing wrong, but I'm sure it's something simple. Any help would be greatly appreciated. Thanks!

1 Answers1

0

I found the problem. The foot-note in this solution mentions that the updated values of variables set using setx are not available until AFTER the script/terminal session as ended. I knew that set wasn't permanent and setx was, but I didn't realize that setx updates would not be available until I close and open a new command prompt.