New install of Vim 8.1.1 on Windows 10 64bit. Also running cygwin.

From a Windows Explorer r-click context menu for a file, the "Edit with Vim" produces a cmd.exe window with:

C:\WINDOWS\system32\cmd.exe /c <symlink>ÿþ/
The system cannot find the file specified.
shell returned 1
Hit any key to close this window...

I hit any key and get a Vim alert dialog saying


Clicking ok then continues on to successfully open the file in gVim.

If I select an option to "Edit with existing vim <some already open file>", it works fine, opening up the target file in the specified existing Vim window.

I did find https://superuser.com/questions/753537/windows-vim-symlink-config-file-persistent-error. This talks about symlinks to vimrc/gvimrc files, but I case insensitive check of_all_ the files on disk with a name containing "vim" and the only ones with symlinks are for cygwin versions of things like "evim", "rvim", etc.

% for f in $(locate -i vim); do file "$f"; done | grep -i symbolic

(Note: had to muck w/ $IFS to allow spaces in Windows filenames.)

I also tried uninstalling/reinstalling VIM.

After yet more digging I found (using process explorer on the blocking cmd window) that gvim is actually executing vimrun

"C:\Program Files (x86)\Vim\vim81\vimrun" C:\WINDOWS\system32\cmd.exe /c ÿþ/

From this I found that executing gvim.exe from that vim81 folder does the same thing. It's having trouble finding the _vimrc file. If I specify -u <path to _vimrc> it works. The default location of _vimrc seems to be ...\Vim\. Just copying _vimrc to ...\Vim\vim81\ has no effect.

So now the questions maybe become

  1. How to I make _vimrc findable by gvim.exe?
  2. Do I need to hack the registry to add -u?
  3. If so where exactly? "...\gvim.exe" "%1" occurs multiply in the reg

Been living with this for months now, but would really like to get it figured out. Thanks in advance!

  • ÿþ is how the UTF-16 byte order mark (BOM) shows when it's incorrectly interpreted as UTF-8, or when someone uses a BOM with UTF-8 (which you shouldn't but sometimes people do). I don't know if it's related and don't really know more than that, but that's the origin of those characters. May 24, 2019 at 8:31

1 Answer 1


Found a solution/hack: If you set a Windows %HOME% environment variable to a path for a folder that contains _vimrc things will work.

Experiments with MYVIMRC, MYGVIMRC, and VIM environment variables didn't work for me in spite of doc to the contrary in :help _vimrc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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