Windows 7 Enviornment Variables will not stick through CMD or Power Shell (even if I run them as admin)

flip66

New Member
I have tried numerous times in both Command Prompt and Power Shell to set the Environment Variable for "Path" and it will not stick. I have tried running as admin as well.

If I test it in the open CMD or Powershell Window it seems to stick, but if I open a new window it is gone. If I go through System Properties and add it manually that way, it works just fine. Unfortunately I need it to work through a batch file or script.

I am running Windows 7 Pro 64-bit.

CMD code I have tried:
Code:
Set Path = C:\Program Files\Java\jdk1.7.0\bin;%Path%
Code:
Set Path = C:\Program Files\Java\jdk1.7.0\bin\;%Path%
Code:
Set Path = "C:\Program Files\Java\jdk1.7.0\bin";%Path%
Code:
Set Path = "C:\Program Files\Java\jdk1.7.0\bin\";%Path%

Power Shell code I have tried:
Code:
$Env:Path = $Env:Path + ";C:\Program Files\Java\jdk1.7.0\bin"
Code:
$Env:Path = $Env:Path + ";C:\Program Files\Java\jdk1.7.0\bin\"
 
Back
Top