Our company has recently changed to networked home directories. This includes setting enviroment variables.

This has created the odd situation that gvim thinks my home directory is :

:echo $HOME

but I cannot change the current directory to that drive or edit any files there. This also means that my vimrc is not loaded.

:cd H:\
E344: Can't find directory "H:\" in cdpath
E472: Command failed 

Can any one help me get vim to change to H:\ and edit files there?
I use Windows 7, gvim 7.4

EDIT I tried later CREAM versions 7.4.638 (the latest) and 7.4.099 (closest to 7.4.096 suggested by Christian Brabandt), both had the same error.


Thanks for suggestions, but none have helped so far.

I can change to h:\ in the vim.exe file which comes with Git on windows (vim 7.3, 32 bit windows console version, but not any of the gvim versions I have tried.

  • Using :cd F:/ and :cd F:\ (I don't have a H:) works for me on Windows 7 with Vim 7.4 with no patches (as downloaded from www.vim.org)... I can't reproduce this problem.... :-/ Mar 26 '15 at 15:42
  • I'm having this problem when I launch vim from certain programs, but not when I launch it from the start bar. Version: 8.0.
    – Ed Brannin
    May 17 '17 at 19:04

This was a bug, that was fixed in 7.4.096. (You didn't specify exact version, so I assume, you are using plain 7.4 version and I used to have the same problem when cding into a UNC path)

  • Answered by the contributor of the patch himself! Mar 19 '15 at 21:07
  • Is there a way to download a compiled version of 7.4.096 for Windows? Mar 20 '15 at 0:17
  • @ChestertheRooster I believe using the builds from Cream (sourceforge.net/projects/cream/files/Vim) are the way to go. Mar 20 '15 at 12:55
  • Thanks, but I downloaded vim 7.4.638 from the cream link (above), and get same error E344: Can't find directory "H:\" in cdpath Mar 22 '15 at 23:33
  • @ChestertheRooster I have a similar setup at work and `:cd H:\` works fine for me. Are you sure the network drive is mounted?
    – jamessan
    Mar 26 '15 at 18:13

I solved this problem myself by using Haroogan vim. When I cd to h:\ in Haroogan vim it works, and it also successfully runs my vimrc files there.

I guess this was either something strange about my work's network drive and/or a bug in vim that will eventually be resolved. Still, if you have this problem, I would try Haroogan vim.


Perhaps try :cd H:? Purely guessing based on the contents of :help dos-:cd http://vimdoc.sourceforge.net/htmldoc/os_dos.html#dos-:cd


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.