A guide to using Windows 11 and 10 environment variables for profiling
Environment variables are the location paths (or environments) where applications and programs are run. They can be created, edited, managed or deleted by the user and come in handy when managing the behavior of certain processes.
Here's how to create a configuration file to manage multiple variables simultaneously without having to edit them individually on Windows.
How to use profiles in environment variables Windows 11 and 10
On Windows, there are two sets of environment variables – user variables (apply to the current user) and system variables (apply globally). However, using a tool like PowerToys, you can create a separate configuration file to add new and existing variables and manage them all at once. Here's how:
Step 1: Install PowerToys
PowerToys has an environment variable tool that can be used to create configuration files to manage environment variables. To use it, you first need to install PowerToys. To do this, open the Microsoft Store.
Search for PowerToys.
Click "Install".
You can also install PowerToys from its GitHub page as follows:
Click the download link on the GitHub page.
After downloading, run the PowerToys installer.
Agree to the terms and conditions and click Install.
Step 2: Enable environment variables in PowerToys
Launch PowerToys and click "Environment Variables" on the left .
On the right, open Enable environment variables.
Also, make sure to turn on "Start as Administrator" so you can make changes to the System variables if needed.
Step 3: Set up a new configuration file
Click"Start Environment Variables" to open it.
In the Environment Variables window you will find two default variable profiles on the left - User and System.
The applied variables will be on the right.
To add a new profile, click the New Profile option in the upper left corner.
and give your profile a name.
Step 4: Add Variables – New and Existing Variables
Click "Add Variable" to do this .
Here you can add new and existing variables in the configuration file. To add a new configuration file, enter the name and value of the environment variable under New.
Then click Add at the bottom.
Your new environment variables will be added to your configuration file.
To add an existing variable, click the Existing tab.
Then select the variable you want to add.
Then click Add at the bottom.
Finally, click Save.
Step 5: Edit or Delete Variables
Your custom environment variable profile will be listed under the Profiles section. Click the down arrow next to it to view the variables that belong to the profile.
#To edit or delete a variable in the configuration file, click the three-dot icon next to the variable.
Select "Edit" to modify its name or value.
Make the necessary changes and click Save.
Select "Remove" to remove the variable from the configuration file.
Click "is" to confirm.
To edit the profile itself, click the three-dot icon next to the profile and select Edit.
This will take you to the same window as before, where you can add (and edit) new and existing variables.
To delete the profile, select "Delete".
Select "is" to confirm.
Step 6: Enable or disable the configuration file
Finally, don’t forget to open the configuration file to apply the variable set that has been added to it.
The applied variables will appear on the right side of the Environment Variables window.
Please note that you can only apply one profile at a time, regardless of the number of profiles you create.
To disable a profile, simply close it.
What happens when creating a configuration file in environment variables?
Then, the variables you add to that configuration file will take over user and system variables when they are common. You will be able to easily turn variables on and off by opening or closing the configuration file respectively. It won't change what's in the user and system environment variables, but if those three variables were common, the order of precedence would be like this: Profile > User > System.
Why use configuration files in environment variables
By using a separate configuration file for environment variables, you can do the following:
- Easily add what you need new variables without changing user and system variables.
- Manage a group of variables at a time.
- Highlight variables with the same name as user variables.
PowerToys' Environment Variables tool also allows you to manage existing user and system variables from the Default Variables section. Just make sure you run the tool as an administrator to allow changes to system variables.
FAQ
Let's look at some frequently asked questions about using profiles with environment variables on Windows.
How to use PowerToys to modify default system variables?
To modify the default system variables, run the Environment Variables tool in PowerToys as an administrator. Then click the System tab under Default Variables, click the three-dot icon next to the variable you want to modify, and select Edit or Delete.
Which variable has priority between configuration files and user variables with the same name?
If two variables have the same name, the variable belonging to the configuration file will get priority. The order of precedence of public variables is as follows: Profile>User>System.
Can you use two configuration files? What happens when I create multiple profiles?
Well, you can only use one profile at a time. You can create multiple profiles, but only one can remain active at a time.
The above is the detailed content of A guide to using Windows 11 and 10 environment variables for profiling. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
