Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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: http://xahlee.org/mswin/env_var.html 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
SET VAR_NAME=value

See the Microsoft Documentation for the details.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.