用户变量和系统变量有什么区别?

发布于 2024-10-07 22:06:03 字数 101 浏览 0 评论 0原文

PATHTMP等用户变量和系统变量有什么区别?

我不小心删除了用户变量PATH。我该怎么办?

What is the difference between user variables such as PATH, TMP, etc. and system variables?

I accidentally deleted the user variable PATH. What am I supposed to do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

金橙橙 2024-10-14 22:06:03

右键单击我的电脑,进入属性->高级->环境变量...

上面是用户变量,下面是系统变量。在为应用程序创建环境时将组合这些元素。系统变量为所有用户共享,但用户变量仅适用于您的帐户/个人资料。

如果您不小心删除了系统控件,请打开注册表编辑器,然后转到 HKLM\ControlSet002\Control\Session Manager\Environment(假设您当前的控制集不是 ControlSet002)。然后找到Path值并将数据复制到HKLM\CurrentControlSet\Control\Session Manager\EnvironmentPath值中。您可能需要重新启动计算机。 (希望这些备份不是很久以前的,并且它们包含您需要的信息。)

Right-click My Computer and go to Properties->Advanced->Environmental Variables...

What's above are user variables, and below are system variables. The elements are combined when creating the environment for an application. System variables are shared for all users, but user variables are only for your account/profile.

If you deleted the system ones by accident, bring up the Registry Editor, then go to HKLM\ControlSet002\Control\Session Manager\Environment (assuming your current control set is not ControlSet002). Then find the Path value and copy the data into the Path value of HKLM\CurrentControlSet\Control\Session Manager\Environment. You might need to reboot the computer. (Hopefully, these backups weren't from too long ago, and they contain the info you need.)

我的奇迹 2024-10-14 22:06:03

环境变量在中进行“评估”(即它们被归因)
以下顺序:

  1. 系统变量
  2. autoexec.bat 中定义的变量
  3. 用户变量

每个进程都有一个环境块,其中包含一组环境变量及其值。环境变量有两种类型:用户环境变量(为每个用户设置)和系统环境变量(为每个人设置)。子进程默认继承父进程的环境变量。

由命令处理器启动的程序继承命令处理器的环境变量。

环境变量指定文件的搜索路径、临时文件的目录、特定于应用程序的选项和其他类似信息。系统为每个用户维护一个环境块,并为计算机维护一个环境块。系统环境块代表特定计算机的所有用户的环境变量。用户的环境块表示系统为该特定用户维护的环境变量,包括系统环境变量集。

Environment variables are 'evaluated' (ie. they are attributed) in the
following order:

  1. System variables
  2. Variables defined in autoexec.bat
  3. User variables

Every process has an environment block that contains a set of environment variables and their values. There are two types of environment variables: user environment variables (set for each user) and system environment variables (set for everyone). A child process inherits the environment variables of its parent process by default.

Programs started by the command processor inherit the command processor's environment variables.

Environment variables specify search paths for files, directories for temporary files, application-specific options, and other similar information. The system maintains an environment block for each user and one for the computer. The system environment block represents environment variables for all users of the particular computer. A user's environment block represents the environment variables the system maintains for that particular user, including the set of system environment variables.

当爱已成负担 2024-10-14 22:06:03

系统环境变量可供所有用户全局访问。
用户环境变量仅特定于当前登录的用户。

System environment variables are globally accessed by all users.
User environment variables are specific only to the currently logged-in user.

吃颗糖壮壮胆 2024-10-14 22:06:03

只需在用户中重新创建 Path 变量即可。转到用户变量,突出显示路径,然后新建,输入值。查看具有相同版本窗口的另一台计算机。
通常在 Windows 10 中:路径 %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;

Just recreate the Path variable in users. Go to user variables, highlight path, then new, the type in value. Look on another computer with same version windows.
Usually it is in windows 10: Path %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;

锦上情书 2024-10-14 22:06:03

环境变量(可以访问任何地方/动态对象)是一种变量。它们是系统环境变量和用户环境变量两种。

系统变量具有预定义的类型和结构。用于系统功能。系统产生的值存储在系统变量中。一般用大写字母表示

例如:HOME,PATH,USER

用户环境变量是由用户决定的变量,用小写字母表示。

An environment variable (can access anywhere/ dynamic object) is a type of variable. They are two types of system environment variables and user environment variables.

System variables have a predefined type and structure. That are used for system functions. Values which are produced by the system are stored in the system variable. They generally indicated by using capital letters

Example: HOME,PATH,USER

User environment variables are the variables that determined by the user, and are represented by using small letters.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文