2

I'm having a problem with the PATH environment variable. If I look at the PATH in the environment variables in System Properties, I get this (added newlines for readability):

C:\app\User\product\11.2.0\dbhome_1\bin;C:\Python34\;C:\Python34\Scripts;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\Windows Live\Shared;C:\Program Files(x86)\CMake\bin;
C:\Program Files\Microsoft\Web PlatformInstaller\;
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;
C:\Program Files (x86)\Livestreamer;C:\Program Files (x86)\Git\cmd;
C:\MinGW\bin;C:\Program Files (x86)\Skype\Phone\;
C:\Program Files\Haskell Platform\7.10.3\mingw\bin;
C:\Program Files\Microsoft Network Monitor 3\;
C:\Program Files\Java\jdk1.8.0_20\bin;C:\Users\User\Anaconda3;
C:\Users\User\Anaconda3\Scripts;C:\Users\User\Anaconda3\Library\bin;
C:\Users\User\Anaconda\Lib\site-packages;C:\gradle\bin

But if I open cmd with the Run dialog and write PATH, I get:

PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Haskell\bin;C:\Program
 Files\Haskell Platform\7.10.3\lib\extralibs\bin;C:\Program Files\Haskell Platfo
rm\7.10.3\bin;C:\gurobi605\win64\bin;C:\Perl\site\bin;C:\Perl\bin;C:\app\User\pr
oduct\11.2.0\dbhome_1\bin;C:\Python34\;C:\Python34\Scripts;C:\Program Files\Comm
on Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Micro
soft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live
\Shared;C:\Program Files(x86)\CMake\bin;C:\Program Files\Microsoft\Web Platform
Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\P
rogram Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program File
s (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\Microsoft SQL Serv
er\120\DTS\Binn\;C:\Program Files (x86)\Livestreamer;C:\Users\User\AppData\Roami
ng\npm;C:\Program Files (x86)\Git\cmd;C:\MinGW\bin;C:\Program Files\Microsoft SQ
L Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\1
10\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Fi
les (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files
 (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;C:\Program Files\Haskell Platform\
7.10.3\mingw\bin;C:\Program Files\Microsoft Network Monitor 3\

Can I somehow make them the same? I need to use the PATH in the System Properties, not the one in the command line.

I tried changing the path in the command line using set PATH="(new path)", but that only changes it temporarily. It turns back if I close and open a new console window.

I also tried setx PATH "(new path)" but it doesn't change anything either.

I'm using Windows 7 Home Premium 64-bit

devil0150
  • 1,017
  • 3
  • 12
  • 24

2 Answers2

0

This is because the variable PATH has different scopes and thus can have different contents. These scopes are user and machine. setx sets user variables (HKEY_CURRENT_USER) but if you add the switch /m then these variables will be set system-wide (HKEY_LOCAL_MACHINE).

System Properties shows the user scoped variables contents, while echo %PATH% shows system-wide contents.

If you want to have the same contents in both permanently you can use PowerShell as described here.

Community
  • 1
  • 1
Fairy
  • 3,116
  • 2
  • 21
  • 36
  • I just tried "$env:Path = (path I want)" in powershell, like the link said, but the path I see in cmd doesn't change. Did I set the system or user PATH? How do I set the other? – devil0150 Jul 05 '16 at 15:18
  • It seems it only changed the user path. I changed the system path through the registry. – devil0150 Jul 05 '16 at 15:35
  • 1
    `[Environment]::SetEnvironmentVariable( "Path", " – Fairy Jul 05 '16 at 15:36
0

There are two type of variables are in Windows. User variables and System variables. You can see and edit its. Open System Properties, open Advanced tab, click on Environment Variables button. Just added that do you need to the properly variables zone.

Stan Dudikoff
  • 94
  • 1
  • 8