Programmer | Reinstall the system to save environment variables and personal configuration
1. Back up the environment variable registry
Win+R
, enter regedit
, and press Enter to open the Registry Editor.
Environment variables are in the following two places:
-
System environment variables:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
-
User environment variables:
HKEY_CURRENT_USER\Environment
Locate the system environment variables and user environment variables respectively, and right-click Export to export to backup.
2. Back up with the set command in the command
Execute on the command line:
set >> d:\tmp\environment.txt
You can back up the environment variables to a file.
d:\tmp\environment.txt
It is the path and name of the saved backup file. The path must d:\tmp\
exist, otherwise an error will be reported.
3. Restore environment variables (registry restore only)
Double-click the exported reg
file to import it. However, it is very likely that the environment variables cannot be used due to the different storage locations of the environment variables. Therefore, before importing, it is best to find out the storage location of the environment variable in the current system, and then use " 记事本
" to open reg
the file, and change the key value to the key value of the current environment variable storage location. After importing, restart the system.
come on!
grateful!
effort!