/
/

How to Add the Environment Variables Context Menu in Windows 10

How to Add the Environment Variables Context Menu in Windows 10 blog banner image

To modify Windows environment variables, you need to dig into the system, which can be laborious when you have to do it repeatedly. Fortunately, you can add an “Environment Variable” shortcut in the context menu to make your life much easier. If you’re a developer, IT professional, or power user who frequently views or edits environment variables for your tasks, this article is for you. Keep reading to learn how to add Environment Variables in the context menu in Windows 10 using the Registry Editor, or learn more about environment variables first.

Using the Registry Editor to add “Environment variables” to the context menu

⚠️ Before following the steps below, know that you’ll modify the registry. So, you must sign in as an administrator to be allowed to make changes. Make sure you also back up the registry before modifying it. This will enable you to restore a working registry later if you accidentally make mistakes that can destabilize the system.

You must access the Registry Editor to modify the context menu’s contents. Here are the steps to add a Windows desktop “Environment variables” shortcut to the right-click menu.

Step 1: Open the Registry Editor.

You must launch the Registry Editor as an administrator. To do this, press Windows key + R, type “regedit,” then press Ctrl + Shift + Enter.

Step 2: Navigate to the shell key.

On the left pane of the Registry Editor, go to:

HKEY_CLASSES_ROOT\Directory\Background\shell

Step 3: Create the new key for the context menu.

  1. On the left pane, right-click the shell folder, hover over New, then choose Key. Name this new key “Environment Variables.”
  2. Double-click the (Default) value on the right pane to open the Edit String dialog box.
  3. Under Value Data, type “Environment Variables”, then hit OK.

Optional step: Add an icon.

  1. On the left pane, right-click the Environment Variables key, hover over New, and select String Value. Name it “Icon.”
  2. On the right pane, double-click Icon and set its value to SystemPropertiesAdvanced.exe.

Step 4: Create the command subkey.

  1. On the left pane, right-click the Environment Variables key, hover over New, and choose Key. Name it “command.”
  2. In the right pane of the command key, double-click (Default).
  3. Set Value data to SystemPropertiesAdvanced.exe.

This command opens the System Properties > Advanced tab, where the Environment Variables button is located.

Checking the results

To see if the changes to the registry worked, try the following steps:

  1. Right-click on an empty area on the desktop and find the Environment Variables option from the context menu.
  2. Click Environment Variables. It should open the System Properties window directly to the Advanced tab, allowing quick access to edit environment variables.

How to remove the Environment Variables entry in the context menu

You can always remove the Environment Variables option if you no longer use this shortcut or think it clutters your context menu. Follow these steps:

  1. Open the Registry Editor. Press Windows key + R, type “regedit”, and press Ctrl + Shift + Enter.
  2. Navigate to this key:

HKEY_CLASSES_ROOT\Directory\Background\shell

  1. On the left pane, delete the Environment Variables key.
  2. Close the Registry Editor. The option will be gone from the right-click menu.

What are environment variables in Windows?

Environment variables are Windows settings that the operating system and applications use to retrieve important information like file paths and configurations. Because of their functions, they can affect how running processes behave on a computer. Environment variables have two categories:

  1. User variables: The user variables in Windows 10 are specific only to the user who is currently logged in.
  2. System variables: All users in the system can access these variables.

Environment variables are key-value pairs, meaning that a single variable has a name (key) and a value and can be used in various contexts, like in shell scripts, command-line programs, and applications running within a shell environment. Some examples of key names and their functions include:

  • PATH: tells the system where to look for executable files
  • USERPROFILE: indicates the location of the user’s home directory
  • TEMP: specifies the location for temporary files
  • USERNAME: stores the current user’s name
  • OS: stores the operating system version
  • JAVA_HOME: points to the installation location of the Java Development Kit or Java Runtime Environment

Why add Windows system environment variables to the context menu?

When you want to access the environment variables, you can either type “environment variables” in the search box of the Start menu. Alternatively, you may take the long route by right-clicking on the This PC icon, selecting Properties, clicking Advanced system settings, and finally choosing the Environment variables… button. Although these are relatively quick steps, doing them over and over again can be exhausting when you need to view or edit environment variables often.

Adding an Environment variables shortcut to the context menu will help advanced users by reducing the steps required to access these settings. This will improve the workflow of developers or system admins who must make frequent changes while configuring apps and enabling or disabling program features. With the option immediately available on the right-click menu, IT pros no longer need to navigate through the Control Panel or System Properties every single time.

Frequently Asked Questions (FAQs)

Can I make this context menu available in folders instead of the desktop?

Yes, you can. However, you must use a different registry path to make this method work inside your folders. Consider using this one:

HKEY_CLASSES_ROOT\Directory\shell

Does this work on Windows 11?

This tutorial is confirmed for Windows 10. It should work if you try it on Windows 11, but the results may vary due to UI changes. For one, the new option may be hidden in “Show more options” due to Windows 11’s truncated right-click menu. You’ll need to get the full context menu before following these steps to get the same results.

Will this context menu item affect system performance?

No. The “Environment Variables” option in the context menu will only add a new entry in the registry for your convenience. Given that you correctly follow the instructions for editing the registry, the process for adding the option is also safe and won’t affect system performance.

Improving your workflow with the Windows environment variables shortcut

When you make the “Environment Variables” option available in your desktop or folders’ context menus, you can streamline your workflow by eliminating additional steps for your tasks. This is ideal for users who frequently tweak or inspect environment settings in Windows 10. Remember, you can easily enable or disable the option using the Registry Editor as needed. As long as you follow the steps discussed carefully and back up the registry before making changes, you can safely make the Environment Variables accessible in the right-click menu.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).