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

Discussion in 'Windows 7 Help and Support' started by flip66, Oct 16, 2011.

  1. flip66

    flip66 New Member

    Joined:
    Oct 15, 2011
    Messages:
    2
    Likes Received:
    0
    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\"
     

Share This Page

Loading...