Add Environment Variables Context Menu in Windows 10

How to Add Environment Variables Context Menu in Windows 10

Environment variables in an operating system are values that contain information about the system environment, and the currently logged in user. By adding a special context menu, you'll be able to see and change them quickly.

Advertisment

Environment variables existed in OSes before Windows as well, such as MS-DOS. Applications or services can use the information defined by environment variables to determine various things about the OS, for example, to detect the number of processes, the currently logged in user's name, the folder path to the current user's profile or the temporary files directory.

Windows 10 environment variables path selected

Windows 10 has several types of environment variables: user variables, system variables, process variables and volatile variables. User environment variables are accessible to all apps which run in the current user context, system environment variables apply to all users and processes on the PC; process variables are applicable only to a specific process and volatile variables are those which exist only for the current logon session. Most interesting of these are user, system and process variables, as we can modify them.

Example: A user environment variable.

Windows 10 User Environment Variable

Example: A system environment variable.

Windows 10 System Environment Variable

Windows 10 stores user environment variables under the following Registry key: HKEY_CURRENT_USER\Environment. System variables are stored under the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.

Here's how the context menu looks:

Windows 10 Environment Variables Context Menu

To Add Environment Variables Context Menu in Windows 10,

  1. Download the following ZIP archive: Download ZIP archive.
  2. Extract its contents to any folder. You can place the files directly to the Desktop.
  3. Unblock the files.
  4. Double click on the Add Environment Variables Context Menu.reg file to merge it.
  5. To remove the entry from the context menu, use the provided file Remove Environment Variables Context Menu.reg.

You are done!

How it works

The Registry files above modify the Registry branch: HKEY_CLASSES_ROOT\DesktopBackground\Shell\EnvVars. This means that the context menu will be available to all Windows user accounts.

Tip: See how to go to a Registry key with one click.

Both entries execute the following command: rundll32.exe sysdm.cpl,EditEnvironmentVariables.

rundll32 sysdm.cpl EditEnvironmentVariables

When started non-elevated, it opens the Environment Variables window that won't allow editing system variables. The other entry starts this command as Administrator, so you will be able to edit system variables as well.

Also, you can use that command to create an Environment Variables shortcut in Windows 10.

That's it.

Advertisment

Leave a Reply

Your email address will not be published. Required fields are marked *