本文介绍了覆盖Windows环境变量值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想永久更改Windows的"Username"变量的值,以解决Windows 8用户配置文件文件夹名称的问题.

I want to permanently change the value of the "Username" variable of Windows to fix a problem of my Windows 8 with the user profile folder name.

我尝试使用SETX工具设置新的环境变量,如下所示:

I've tried to set a new environment variable using SETX tool like this:

SETX /M Username "value"

...已生成新变量,我可以在注册表中将其与其他变量一起看到,但不会被覆盖,因为如果我尝试显示Username变量的值,它将显示旧值.

...The new variable is generated, I can see it in the registry with the other variables, but is not overrided 'cause if I try to display the value of Username variable the it displays the old value.

有可能做我想做的事吗?

Is it possibly to do what I want?

推荐答案

CMD 在启动时读取系统环境变量.要重新读取这些变量,您需要重新启动 CMD .

CMD reads the system environment variables when it starts. To re-read those variables you need to restart CMD.

对于变量%USERNAME%:该变量将自动填充当前登录用户的用户名.您必须更改用户名才能更改该变量的值.请勿篡改.

As for the variable %USERNAME%: that variable is automatically populated with the username of the currently logged-in user. You'd have to change the username to change the value of that variable. Don't tamper with it.

这篇关于覆盖Windows环境变量值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-19 17:42