0

I was trying to get vim going in powershell, and so I added C:\Program Files (x86)\Vim\vim82 to the PATH. However, when I try to run vim in powershell, it goes to the wrong folder, C:\Program Files (x86)\vim\vim80\vim.exe (note that it is incorrectly vim80 instead of the correct folder name of vim82).

There's nothing else in the path that would send it to vim80, and the vim80 folder doesn't even exist on my computer, so I'm kind of confused as to how that might happen...

And the desired vim.exe executable does run successfully if I actually navigate to the correct vim82 folder.

Lee_Dailey
  • 7,292
  • 2
  • 22
  • 26
user49404
  • 732
  • 6
  • 22
  • 2
    Maybe the "vim80" path is in the user "PATH" variable and the correct one in the system "PATH" variable (or vice versa)? – zett42 Jan 20 '21 at 18:06
  • I added the correct vim82 path to both the system and user PATH variables, and still same issue... pretty odd. I don't even understand how my computer has ever heard of the the wrong vim80 path anywhere. – user49404 Jan 20 '21 at 18:09
  • Check if the bad path is listed under `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths` or `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths`. See https://learn.microsoft.com/en-us/windows/win32/shell/app-registration#using-the-app-paths-subkey – zett42 Jan 20 '21 at 18:15
  • 1
    Depending on the way on how you change your environment variables and where you use them, it might be necessary to reboot your machine or at least renew your PS session prior to use them. Just to be sure, what is the output of `[Environment]::GetEnvironmentVariable('PATH', 'Machine'); [Environment]::GetEnvironmentVariable('PATH', 'User')`? If you want to dive a little deeper into PowerShell and environment variables, you might want to check out my answer [here](https://stackoverflow.com/a/63008393/11942268). – stackprotector Jan 20 '21 at 18:16

0 Answers0