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?
System properties are specified with command-line options in Java using the -Dname=value while environment variables are set in the operating system, using the EXPORT command in Unix and SET command in windows.
User environment variables, as the name suggests, are environment variables that are specific to each user account. This means that the value of a variable when logged in as one user can be different than the value of the same variable when logged in as a different user on the same computer.
A regular user environment variable overrides completely a system one with the same name if both exist, but only for the specific user it is specified for. However, the user path variables is treated differently. It is appended to the system path variable when evaluating, rather than completely replacing it.
You can define system variables for any or all of the entries in the Systems table. The collection of variables for a system is called the system variable pool. To work with system variables, select a single system on the Systems table, then use the System Variables action. This displays the System Variables table.
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.)
Environment variables are 'evaluated' (ie. they are attributed) in the following order:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With