I am not sure that this will do the right thing on windows. on Windows, $HOME/vimfiles is actually the equivalent of .vim, so just looking for vimfiles will not help. see :help rtp.