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 am trying to use a package called virtualenv for Python, which temporarily changes the PATH environment variable to add a certain directory and give convenient access to several executables. My problem is that this doesn't seem to work. The directory gets added to the start of the path as expected, and I can verify this by typing PATH at the prompt, but if I type the name of an exe in that directory, it doesn't run. If I navigate to that directory however, the app will run ok. It seems like Windows is ignoring the altered environment variable, perhaps using what was listed for PATH in the registry (eg. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path).

Does anybody know what could be causing this? I am running as an administrator on Windows 7.

share|improve this question

closed as too localized by Daniel Beck Jun 20 '13 at 5:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Are you trying to execute the application from the same command prompt where you verified the modified PATH, or a different one? –  haimg Oct 10 '11 at 18:42
    
The same one. Literally in the next command in that window. –  Kylotan Oct 10 '11 at 18:55
    
Are you typing the file extension as well? Is the extension listed in %PATHEXT%? –  grawity Oct 10 '11 at 19:35
    
These are .exe files, so the answer is "No" and "Yes" respectively. –  Kylotan Oct 10 '11 at 21:05
    
Will Windows launch any other programs from said folder in the path or is it just that file? Something tells me the path was typed in wrong. –  surfasb Oct 10 '11 at 21:28

1 Answer 1

It seems that the cmd does load the environment variables when it is created, and you have to close it and open a new one to have those refreshed.

There may be a command to force it to refresh the env_vars -

share|improve this answer
1  
That doesn't sound right, if you have changed the path from inside cmd, I'm fairly sure it updates right away. –  David Jun 19 '13 at 16:30
1  
Well if you change it using the GUI stuff, which makes total sense on a GUI OS, it does not. also people who -1 should think about how that's going to help the poor guys who make the exact same mistake. –  Morg. Jun 21 '13 at 9:53

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