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'd like to set a temporary enviroment variable in windows CMD line, which in my word the windows shell. because it's for temporary usage, So I don't want to add a new enviroment variable system wise by clicking "my computer-->properies---" ...

by the way, the envrioment variable I'd like to set is http proxy, but I don't known the windows syntax for that. so if you happen to know it as well, please tell me and I'll apreciate you even more ...

share|improve this question

To set a temporary or 'per session' environment varible from a command line you can use:

set ‹var name›=‹value>

Make sure your spacing is exactly as shown above, if you add a space between the equal sign the command will fail.

Check: for a nice tutorial and info on environment variables.

share|improve this answer
It's not so much per session as per process and child process. Other processes already running in your login session will not see this new (or changed) variable, only the current cmd.exe process and any processes launched from it. – Richard Nov 18 '10 at 8:22
Sorry, with session I meant the current process; I just noticed that calling it session may be a bit confusing. – akseli Nov 19 '10 at 13:59

See the Microsoft Documentation for the details.

share|improve this answer

You must log in to answer this question.

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