系统与用户PATH环境变量... winmerge仅在将路径添加到用户PATH时才起作用
如果我将 C:\Program Files(x86)\WinMerge
添加到用户 PATH
变量通过右键单击计算机 - >高级系统设置 - >环境变量),一旦我打开一个新的cmd shell WinmergeU.exe无法识别。如果我将该路径添加到系统 PATH
变量,则WinmergeU.exe被正确识别。虽然User和System之间没有任何区别,但是如果我将其设置为System,所有的用户都将看到它,而User PATH
是本地的。我做错了吗?
If I add C:\Program Files (x86)\WinMerge
to the User PATH
variable(by right click on computer -> advanced system settings -> environmental variables), once I open a new cmd shell WinmergeU.exe is not recognized. If I add that path to the System PATH
variable, WinmergeU.exe is correctly recognized instead. I though there was no difference between User and System, beside the fact that if I set it on System all the users will see it, while the User PATH
is local. Am I doing something wrong?
编辑1:
在下面你可以首先看到 C:\程序文件(x86)\WinMerge
被添加到系统 PATH
变量(但不是用户),那么当它添加到用户 PATH
变量(但不是系统)。在第一种情况下,Winmerge窗口正确启动(未显示),您可以看到路径由echo%PATH%命令显示。在第二种情况下,它不启动,路径不会被echo%PATH%显示。 (请注意,在使用这些屏幕截图之前,我已经清楚地确认并关闭环境变量窗口,并且在更改PATH之后立即打开一个新的cmd,然后按OK)。这个问题可能与我的问题有关( echo%PATH%只能扩展为系统还是用户变量?),但由于可能不会发布两个不同的问题。
In the follow you can see first the case in which C:\Program Files (x86)\WinMerge
is added to the System PATH
variable (but not to the User), then when it is added to the User PATH
variable (but not to the System). In the first case Winmerge window launch correctly (not shown) and as you can see the path is shown by the echo %PATH% command. In the second case it does not launch and the path it is not shown by echo %PATH%. (note that I clearly confirmed with OK and closed the environmental variable windows before taking these screenshots, and I opened a new cmd right after changing PATH and pressing ok). This issue might be related to my question here (Does echo %PATH% expand to only the system or also the user variables?) but since it might not be I posted two different question.
您的机器必须出现问题,或出现环境问题。添加用户 PATH
环境变量确实导致它被合并到新进程的环境中。
You must be getting something wrong, or have environmental problems with your machine. Adding a user PATH
environment variable does result in it being merged into the environment of a new process.
更新:也许这个 MSDN关于环境变量的主题的评论可能是相关的:
Update: Perhaps this comment from the MSDN topic on environment variables might be pertinent:
发现在Windows Server 2003上,系统PATH通过1920个字符后,用户PATH环境变量为较长时间合并以设置过程PATH环境变量,即使完整的系统PATH(即使较大)也将包含在进程PATH变量中。
Found out that on Windows Server 2003, once the system PATH passes 1920 characters, the user PATH environment variable is no longer merged with it to set the process PATH environment variable, even though the full system PATH (even if larger) will be included in the process PATH variable.