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.

insert image description here
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

insert image description here
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.

insert image description here
d:\tmp\environment.txtIt 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 regfile 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 regthe file, and change the key value to the key value of the current environment variable storage location. After importing, restart the system.

Link

come on!

grateful!

effort!

Guess you like

Origin blog.csdn.net/qq_46092061/article/details/131034332
Recommended