CS COURSE

System variables vs. User variables

bona.0 2023. 1. 4. 16:17

Environment variables

  • string variables storing data to manage services and applications
  • Applications use environment variables to determine the location for installing files, storing temporary files, and locating user profile data.
  • (ex) %windir TEMP PATH

 

Environment variables fall into two categories

1. System variables

  • all users can access system environment variables.

 

2. User variables

  • only the logged-in user at that moment can access the user variable.
  • takes precedence over system variables except in the case of special system variables like PATH.
    ➡ If a user creates a variable with the same name as a system variable, the user-created local variable is used instead of the system variable. However, it only applies to the person who declared it. If any other user accesses that variable, the system variable will be called.

 

 

(ref) https://www.baeldung.com/cs/user-vs-system-variables