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: 
After you answered the question yourself, the focus shifted. It seems the Question is now "How can I prevent Vim from checking for `$HOME/_vimrc`?".

Try the following:

* Create the file `$USERPROFILE/vimrc` with all your configuration.
* Create the environment variable `VIMINIT` with the value `source $USERPROFILE/vimrc`.

On startup the variable `VIMINIT` is checked first. If it is set, the value of `$VIMINIT` is used as an Ex command line. 

---

Update (I know that the questioner is not interested anymore):

You should also check your `runtimepath`. Most likely it still points to `$HOME/vimfiles` (on Windows). So you should create the directory `$USERPROFILE/vimfiles` to store extended configuration and plugins etc.

At the beginning of `$USERPROFILE/vimrc` you have to fix the `runtimepath`. 
I would try it like this:

```
set runtimepath-=~/vimfiles
set runtimepath^=$USERPROFILE/vimfiles
set runtimepath-=~/vimfiles/after
set runtimepath+=$USERPROFILE/vimfiles/after

```

**After that** you should still change `$HOME`, as others (like netrw) still uses it.

```
let $HOME=$USERPROFILE

```

I'm on Linux, so someone should test this on Windows.
> 
> 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.