0

This question already has an answer here:

I know this is stupid, but last 30 minutes I am trying to change $HOME variable to other value, doing $Env:HOME = "desired value" did nothing for me, I tried couple other suggestions from the first 10 results from Google and not I am actually stuck, hence asking this rather stupid question.

Here is why I want to change it. I gave my laptop to our IT's because my hard disk broke and I had to replace it with new one, so I wanted them to install me fresh Windows image which they did, but then they put for a user name that is stupid and I want to replace.

I searched in internet and saw that changing actually the name of user is not an easy job, so I've decided to create new and move slowly to it. What do I mean move slowly to him? - all my apps currently are working with the previous user (C:\Users\annoyingUser) installing\storing everything there which I would like to change.

Then I noticed that $HOME is referring to C:\Users\annoyingUser and I presume a lot of applications use this variable so I've decided to change it value, but with no success so far.

tl;dr; Can you guys help me change its value, seems like I am missing something?

Things I've tried so far in powershell:

  1. $Env:HOME = "C:\Users\DesiredUser"
  2. Noticed that I don't have such variable(hence asking where $HOME comes from since when I use it in the terminal everything looks fine) in environment variables window so I've added one for the user and one system. - didn't work either way.
  3. [Environment]::SetEnvironmentVariable("HOME","C:\Users\DesiredUser")

marked as duplicate by DavidPostill windows Jun 16 '18 at 22:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Hint: Searching for powershell environment variable HOME would have given you the answer immediately. – DavidPostill Jun 16 '18 at 22:26
  • Well I wasnt expecting to be anything special so I decided to search for something more generic. Oh well.. thank you anyway. – kuskmen Jun 16 '18 at 22:29