Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am really sorry if this question is stupid or something, but how can I make a program (say vim editor) so that I can call it from any directory, even though it is not directly installed in that directory?

I thought setting path would work and that's what the setting path is for, but it's not working. Say my vim.exe is downloaded on my desktop. Is there way for me to be able to just call "vim.exe" from my command prompt, not necessarily on desktop directory, and still open vim editor??

Thank you !

share|improve this question

migrated from Mar 23 '13 at 21:57

This question came from our site for professional and enthusiast programmers.

I doubt if it's possible. For example, how can the OS know if you want to run C:\Some Directory\vim.exe but not C:\Users\Test\Desktop\vim.exe? – Lemurr Mar 23 '13 at 21:03
pls explain why path didn't work for you. if you have c:/foo/vim.exe, and you add c:/foo into path, you could under F:/bar simply type vim.exe, you can start vim. btw, I feel that this question doesn't belong to SO, maybe superuser? – Kent Mar 23 '13 at 21:07
up vote 0 down vote accepted

If you are on windows, then Vim should not be on your desktop. You should use the installer from This will make a folder "C:\Program Files (x86)\Vim\vim73" where your vim.exe and gvim.exe will be. Put this in your path.

Rapid Environment Editor is also a great tool for editing your PATH and any other environment variables:

share|improve this answer

You're correct, it's about PATH. Windows will look for the file in all directories specified in PATH. You should add a path to vim's directory there (not path to the vim executable itself).

Remember that programs load environment variables only on startup, so for example if you open cmd and then change PATH it won't apply to that cmd window instantly, you'll have to reopen it. The same applies to explorer.exe.

Also keep in mind that PATH won't work with everything, for example context menu filetype handlers in registry will accept only full path to the executable (this is true since XP SP2).

share|improve this answer
Perhaps I misunderstand something -- but if you set the path while in a cmd window, it will immediately affect where cmd looks for programs. – echristopherson Mar 24 '13 at 2:12
@echristopherson If you set PATH inside that window, then yes, but the change will be work for that window only. If you make that change globally (systempropertiesadvanced.exe etc.), then what I wrote applies. There's also a tool called setx that will change variable globally. – gronostaj Mar 24 '13 at 7:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .