Well, from XP I’m used to just pop up the current computer properties and just set permanent environment variables. In Vista this is however different. This will require a priviledge elevation, and thus you’ll only be able to edit the admin’s variables, but not the environment of a regular user.
This being said – the answer is quite simple: setx
. To set a variable like JAVAHOME
just call setx JAVAHOME "c:\Program Files\java"
and that’s all.