系统与用户 PATH 环境变量...只有当我将路径添加到用户 PATH 时,winmerge 才有效 [英] System versus user PATH environmental variable...winmerge works only if I add the path to the user PATH

查看:29
本文介绍了系统与用户 PATH 环境变量...只有当我将路径添加到用户 PATH 时,winmerge 才有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将 C:Program Files (x86)WinMerge 添加到用户 PATH 变量(通过右键单击计算机 -> 高级系统设置 -> 环境变量),一旦我打开一个新的 cmd shell WinmergeU.exe 就无法识别.如果我将该路径添加到系统 PATH 变量中,则会正确识别 WinmergeU.exe.我虽然用户和系统之间没有区别,但如果我在系统上设置它,所有用户都会看到它,而用户 PATH 是本地的.难道我做错了什么?

编辑 1:

在下面您可以首先看到将 C:Program Files (x86)WinMerge 添加到系统 PATH 变量(但没有添加到用户),然后将其添加到用户 PATH 变量中(但不添加到系统中).在第一种情况下,Winmerge 窗口正确启动(未显示),正如您所看到的,echo %PATH% 命令显示了路径.在第二种情况下,它不会启动,并且它的路径也没有由 echo %PATH% 显示.(请注意,在截取这些屏幕截图之前,我清楚地确认了 OK 并关闭了环境变量窗口,并且在更改 PATH 并按 OK 后立即打开了一个新的 cmd).这个问题可能与我在这里的问题有关(可能是相关的:

<块引用>

发现在 Windows Server 2003 上,一旦系统 PATH 超过 1920 个字符,用户 PATH 环境变量不再与其合并以设置进程 PATH 环境变量,即使完整的系统 PATH(即使更大)也会包含在进程 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?

EDIT 1:

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.

解决方案

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.

Update: Perhaps this comment from the MSDN topic on environment variables might be pertinent:

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.

这篇关于系统与用户 PATH 环境变量...只有当我将路径添加到用户 PATH 时,winmerge 才有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆