用户注销和登录或从管理员切换到非管理员帐户时出现PATH环境变量问题 [英] PATH environment variable issue when user log-off and login or switch from admin to non-admin account

查看:145
本文介绍了用户注销和登录或从管理员切换到非管理员帐户时出现PATH环境变量问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





安装新产品版本后,当用户注销并登录管理员帐户或从管理员帐户切换到非管理员帐户时, PATH环境变量使用命令提示符显示我的产品的错误路径(以前的产品版本的路径)。



PATH环境变量使用其他环境变量(ABC)。环境变量ABC具有我产品的相对路径(例如:C:\\Program文件\ myProduct_1.0).PATH环境变量(如%ABC%\ bin)在注销和登录管理员帐户(或)从管理员帐户切换到非管理员帐户后不会立即刷新。



如果用户在启动产品之前打开某些应用程序(如Internet Explorer,记事本,写字板,Excel等),则不会出现此问题。导致此问题的根本原因是Windows在启动某些应用程序后刷新PATH环境变量。



在会话更改期间似乎是Windows刷新问题(注销和登录/从管理员切换到非管理员帐户)。



为什么在注销和登录/从管理员切换到非管理员模式后,PATH环境变量不会立即刷新?



请有人帮我解决这个问题。

Hi,

After installing my new product version, when user does log-off and login into admin account or switch from admin account to non-admin account, PATH environment variable shows incorrect path of my product (previous product version’s path) using command prompt.

The PATH environment variable uses other environment variable (ABC).Environment variable "ABC" has relative path of my product(For ex:C:\\Program Files\myProduct_1.0).PATH Environment variable(like %ABC%\bin) is not refresh immediately after logoff and login admin account (or) switching from Admin account to Non-admin account.

This issue will not appear if user opens some applications like Internet Explorer, Notepad, WordPad, Excel, etc., before launching my product. Root cause of this issue is Windows refresh the PATH Environment variable after launching some application.

It seems windows refresh issue during session changes (logoff and login / switch from Admin to Non-admin account).

Why PATH environment variable is not refresh immediately after logoff and login/Switch from admin to non-admin mode?.

Please someone help me for this issue.

推荐答案

根据我的经验,一个人永远不应该引用PATH环境变量中的环境变量,因为它们没有得到解决;所以我很惊讶它对你有用。



我唯一的猜测是当它工作时它是因为某事做了 PATH%PATH%; ... 导致嵌入式环境变量被解析。



如果是也许你可以在你的autoexec.bat或其他东西做同样的事。
It has been my experience that one should never refer to environment variables in the PATH environment variables because they don't get resolved; so I am surprised that it works for you at all.

My only guess is that when it does work it's because something did a PATH %PATH%;... which caused the embedded environment variables to be resolved.

If that is the case, then maybe you could do likewise in your autoexec.bat or something.


这篇关于用户注销和登录或从管理员切换到非管理员帐户时出现PATH环境变量问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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