I'm trying to set my HOME path in Windows 10:
setx -m HOME C:\Users\MyName
Then I check the variable's value:
echo %HOME%
and it returns
c:UsersMyName
This is a pain, since I'm trying to use Git with ssh and it needs to know the home folder where my .ssh folder is stored. What am I doing wrong?
Probably you're calling
setxfrombash. Since\is an escape character in bash and most other Unix shells, it won't result in a literal backslash. You need to escape the backslash itself with\or quote it with':Or just call
setxfrom a Windows shell like cmd or powershell. But as I said, if you need to callsetxfrom a script every time you run it then you're doing it wrong. In that case you need to use a normalset: