加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何更改MS Windows中“本地系统”帐户的%PATH%值?

发布时间:2020-12-14 04:17:45 所属栏目:Windows 来源:网络整理
导读:我正在努力在MS Windows中为“本地系统”帐户设置%PATH%变量. 我在%PATH%变量中添加了一些路径.而这条新路径(包括这条路径中的工具)工作正常. 可以使用CMD运行该路径中的工具而不会出现任何问题. 但是,一旦从ms windows services.msc作为服务运行相同的
我正在努力在MS Windows中为“本地系统”帐户设置%PATH%变量.

我在%PATH%变量中添加了一些路径.而这条新路径(包括这条路径中的工具)工作正常.
可以使用CMD运行该路径中的工具而不会出现任何问题.
但是,一旦从ms windows services.msc作为服务运行相同的工具,它就说没有这样的工具.因此,由于某种原因,%PATH%变量未针对“本地系统”帐户进行更新.

我发现可以通过以下方式访问此帐户CMD:

psexec -i -s cmd.exe

事实上,我发现CMD以这种方式运行,PATH变量没有必要的工具路径.但我不能编辑它;我使用set或setx但在“本地系统”帐户的%PATH%中仍然没有可见的更改.

我想在MS Windows中为“本地系统”帐户设置%PATH%变量.

您需要重新启动Windows.

在重新启动Windows之前,对环境变量所做的更改不会影响在本地系统帐户下运行的服务

If you update environment variables or add new environment variables,you must restart the computer before the changes that you make affect services that run under the Local System account.

This behavior occurs because services that run under the Local System account inherit their environment from the Services.exe process. The Services.exe process receives the environment settings for the Local System account when Windows starts. Because the Services.exe process does not use Windows Messaging,when it receives messages that indicate that a value has changed after Windows starts,the Services.exe process does not update its environment settings. You cannot force a service that is running to acknowledge a dynamic change to the environment of the Local System account.

来源Changes that you make to environment variables do not affect services that run under the Local System account until you restart Windows

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读