Question: I'm using vim 8.1 on windows.
The IT department has set $HOME to a slow network drive.
Every time a file gets written to $HOME vim slows down.

I have $VIM/vimrc with the following content.

```
let $HOME = $USERPROFILE

```

This used to work, but now netrw still creates files on the network drive.

How do I change $HOME so that no slowdown occurs?

Answer: 
> 
> Turns out the culprit was 
> 
> 
> 
> ```
> source $VIMRUNTIME/vimrc_example.vim
> 
> ```
> 
> in my $HOME/\_vimrc. After removing it no files were created anymore.
> 
> 
> 

Never mind. After more testing it didn't work.

**Solution**

Create a vimrc in $VIM with following content

```
let $HOME = $USERPROFILE

```

**This however is not a perfect solution.** 

According to the documentation it first searches $HOME and then $VIM. This means there is a slow access to the network drive to check if there exists a vimrc. This is quite noticeable. To fix that you either have to somehow undo the work of the IT guys or open Vim with -u everywhere. Or just keep Vim open forever.

Or you use an editor with manners that saves its configuration in %appdata% like it's supposed to. I'm out.
You can use the `-u` option to give an alternate *.vimrc* file of your choice when starting vim. As stated [here](https://stackoverflow.com/a/4618301/4211238), you can also use the `$MYVIMRC` variable to automate this (this takes precedence over `$HOME`), which should answer your question.