Or, if you need to keep both versions, make sure the path for the one you want is ahead of the path of the one you don't want. In the example above, c:\ruby\bin was at the head of the path variable, so anything in there will match first: c:\ruby\bin\vim.exe (not that you'd put it there!) would run before the one in Program Files.