Unable to remove cygwin from PATH environment variable

一个人想着一个人 提交于 2019-12-24 09:12:58

问题


I recently had to reinstall Cygwin and in doing so, I have ran into a problem with some application because Cygwin seems to be appended to my PATH environment variable. I have tried to remove this by following these instructions https://www.java.com/en/download/help/path.xml but something strange happens. If I look at the value of Path under 'Environment Variables', Cygwin is not there; however if I type PATH in cmd.exe, I see Cygwin gets appended at the end of the PATH. Can you please help me to know to remove Cygwin from the PATH?

As an example, this is what I see in the Environmental Variables window Path value:

Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;c:\Oracle\11g_R2_x64\Administrator\11.2.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Apps\Anaconda3;C:\Apps\Anaconda3\Scripts;C:\Apps\Anaconda3\Library\bin

And this is what I see in cdm.exe:

PATH PATH=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Clien t\;c:\Oracle\11g_R2_x64\Administrator\11.2.0\client_1\bin;C:\ProgramData\Oracle\ Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS \System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C: \Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Int el(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Man agement Engine Components\IPT;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\App s\Anaconda3;C:\Apps\Anaconda3\Scripts;C:\Apps\Anaconda3\Library\bin;C:\blp\DAPI; C:\blp\DAPI\DDE;C:\Apps\cygwin64\bin

As you can see, I have Cygwin in the second case, whereas I don't have it on the first case.

UPDATE:

Thanks to Patrick for his answer below. Just to complement, in Windows you should be able to edit both the user and system environment variables from the Control Panel as in this screenshot:


回答1:


There are two PATH variables in Windows. Both are available on that page for environment variables. One is in the top pane (User variables) and the other is in the second pane (System variables). They are both called PATH, but they are separate and distinct entities. When you launch cmd.exe, the PATH variable you end up with is the result of combining those two variables. To fix the problem you are seeing here, return to the Environment Variables pane and check both versions (User and System). Based on your PATH variables above, I suspect the User PATH will contain the following three entries:

C:\blp\DAPI; 
C:\blp\DAPI\DDE;
C:\Apps\cygwin64\bin

That's the only functional difference in your cmd.exe PATH and the other on after variables like SYSTEMROOT are expanded. You should be able to delete the Cygwin directory there.



来源:https://stackoverflow.com/questions/42978373/unable-to-remove-cygwin-from-path-environment-variable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!