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 have the following env variables:

VIM_HOME: %ProgramFiles(x86)%\Vim\vim74
PATH: ...%CMD%;%VIM_HOME%;...


@echo off
start vim.exe %*


> echo %ProgramFiles(x86)%
C:\Program Files (x86)
> echo %CMD%
> echo %VIM_HOME%
C:\Program Files (x86)\Vim\vim74

All good so far...

> echo %PATH%

%VIM_HOME% not resolved, but %CMD% was? And consequently:

> vim
'vim.exe' is not recognized as an internal or external command, operable program or batch file.

I don't understand?

share|improve this question
I think you did not paste something correctly, because %ProgramFiles(x86)% has no drive in its path, yet when you evaluate %VIM_HOME% somehow *C:\* is magically introduced. – Andon M. Coleman Feb 5 '14 at 22:14
@AndonM.Coleman: The variable %ProgramFiles(x86)% has the complete path c:\program files (x86) – JSanchez Feb 5 '14 at 22:16
@JSanchez: No it doesn't, it is clear as day: > echo %ProgramFiles(x86)% --> Program Files (x86) – Andon M. Coleman Feb 5 '14 at 22:17
@Kat: For the heck of it, enclose %VIM_HOME% in quotes when adding it to the path. Let us know what happens then. – JSanchez Feb 5 '14 at 22:17
@AndonM.Coleman: Gotcha. The user might've left part of the string out. – JSanchez Feb 5 '14 at 22:18
up vote 0 down vote accepted

Not even sure how to word this "answer," so if you feel you can word it differently, or add something valuable, please do so:

After many attempts (see the comments section under the question) to figure out why the VIM_HOME variable was not working, a suggestion was made to rename the variable from VIM_HOME to _VHOME. The end-user confirmed that this change allowed them to launch VIM via their batch script without an issue. Still, there was no "real" reason why the VIM_HOME variable wouldn't work, unless it's a reserved internal variable to VIM.

share|improve this answer
thanks for your help! – Kat Feb 6 '14 at 2:11

You must log in to answer this question.

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