我试图在Windows中添加C:\xampp\php到我的系统PATH环境变量。
我已经使用环境变量对话框添加了它。
但当我在控制台输入:
C:\>path
它不会显示新的C:\xampp\php目录:
PATH=D:\Program Files\Autodesk\Maya2008\bin;C:\Ruby192\bin;C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;C:\PROGRA~1\DISKEE~2\DISKEE~1\;c:\Program Files\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;D:\Program Files\TortoiseSVN\bin
;D:\Program Files\Bazaar;C:\Program Files\Android\android-sdk\tools;D:\Program Files\
Microsoft Visual Studio\Common\Tools\WinNT;D:\Program Files\Microsoft Visual Studio\Common
\MSDev98\Bin;D:\Program Files\Microsoft Visual Studio\Common\Tools;D:\Program Files\
Microsoft Visual Studio\VC98\bin
我有两个问题:
为什么会发生这种情况?我做错什么了吗?
另外,如何使用控制台(并以编程方式,使用批处理文件)向PATH变量添加目录?
在Windows 10上,我能够搜索set path环境变量,并得到这些指令:
From the desktop, right-click the very bottom-left corner of the screen to get the Power User Task Menu.
From the Power User Task Menu, click System.
In the Settings window, scroll down to the Related settings section and click the System info link.
In the System window, click the Advanced system settings link in the left navigation panel.
In the System Properties window, click the Advanced tab, then click the Environment Variables button near the bottom of that tab.
In the Environment Variables window (pictured below), highlight the Path variable in the System variables section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon, as shown below:
C:\程序文件;C:\Winnt;C:\Winnt\System32
我第一次搜索它时,它立即弹出了系统属性窗口。之后,我找到了上面的说明。