document updated 13 years ago, on Nov 24, 2010
General solutions
I end up putting several programs in the path, so that I can launch them from the Windows+R input box.
Ways I've accomplished this historically:
- make a .bat in C:\Windows\ that sets the correct working directory and launches the desired .exe (this is the solution that the stock Vim installer uses on Windows)
- downside: slower, causes visual flicker
- note: presumably Vim chooses this option because it's cross-compatible, even on much older versions of Windows. However, I rarely/never use versions of Windows older than XP, so this solution isn't needed for me.
- copy the .exe from its normal installed directory into C:\Windows\, and hope it continues to function
- works fine with: gvim.exe, procexp.exe, putty.exe, etc
- downsides: leaves litter in C:\Windows\; sometimes causes confusion since apps start with a different working directory than normal
- make a shortcut to the app in C:\Windows\
- upside: fixes the working-directory problem, so all apps should work fine
- downside: still litters C:\Windows\
- downside: shortcuts DO "fix" the working-directory problem, but often you CLEARLY DON'T want the problem fixed — if you specify a relative path on the command-line, for the application to act on, then changing the working-directory will cause this relative-path to be completely wrong
- NOTE: if you just put the shortcut in C:\Windows\, it will only work from Windows+R.
- to get it to ALSO work from the command-line, you need to modify the environment variable %PATHEXT% to include ".lnk"
- mkdir C:\Windows\Dee_Path\; put shortcuts there; change the path to include that directory
- upside: clearly separates any "litter"
Specific programs
- vim
- the shortcut trick above is no good — it prevents you from using relative paths when specifying which file to edit
- instead:
- copy the entire gvim.exe to the desired directory
- create the environment variable VIMRUNTIME to point to the proper directory (you can test that you've got this working correctly, by seeing it come up with the full menu structure)
- copy these .exes directly
- the shortcut trick above is no good — it prevents you from using relative paths when specifying which file to edit
- .exes which work better copied verbatim include: