1

So I did the mistake of removing an earlier version of Vim manually on Windows without going through the "Uninstall Program" dialog. The result left me with the enviroment variables of "vim" and "gvim" pointing to the old, nonexistent folder when running the commands vim and gvim in cmd.exe.

I can not for the life of me figure out where these are being set. I checked the registry strings using regedit:

HKEY_CURRENT_USER\Environment
and
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

However, none of these locations contain any keys pointing to the obsolete directory.
I also checked the PATH-variables using the normal Environment Variables dialog:

Control Panel\System and Security\System -> Advanced system settings -> Environment Variables

but no cigar.

Does cmd.exe have its own environment variables defined somewhere, or where can I eventually look to find out where the pointers to the old Vim directory is being set?

2
  • Do a full registry search for old folder name (or part of it)
    – DavidPostill
    Sep 24, 2014 at 21:53
  • I actually solved it by reinstalling and uninstalling Vim again, although that doesn't really qualify as a solution. So the obsolete registry entries are probably gone now, but I'd still be interested in an answer.
    – krystah
    Sep 24, 2014 at 22:05

1 Answer 1

1

The Vim installer places wrapper vim.bat and gvim.bat scripts into the C:\Windows directory; I guess those were left-over from the old installation and attempted to launch Vim from the now-gone location. (Vim does this to avoid putting the Vim installation dir into the PATH; I'm not aware of the Vim installer defining any environment variables; so you didn't find any.)

Running the (new Vim) installer again (i.e. %ProgramFiles%\vim\vim74\install.exe) would have provided the option to re-create / overwrite those batch wrappers (this time with the correct path), but as I see, you've also fixed the problem.

1
  • When running the commands vim and gvim from cmd, the error message complained that it could not find the Vim executables in C:\Program Files\vim\vim74\vim.exe or something the likes. Point is it pointed to the Vim folder in the Program Files directory, not in the C:\Windows directory.
    – krystah
    Sep 25, 2014 at 13:04

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.