How to export and import environment variables in windows?

后端 未结 8 1451
粉色の甜心
粉色の甜心 2020-12-22 15:36

I found it is hard to keep my environment variables sync on different machines. I just want to export the settings from one computer and import to other ones.

I thi

相关标签:
8条回答
  • 2020-12-22 16:06

    To export user variables, open a command prompt and use regedit with /e

    Example :

    regedit /e "%userprofile%\Desktop\my_user_env_variables.reg" "HKEY_CURRENT_USER\Environment"
    
    0 讨论(0)
  • 2020-12-22 16:07

    I would use the SET command from the command prompt to export all the variables, rather than just PATH as recommended above.

    C:\> SET >> allvariables.txt
    

    To import the variablies, one can use a simple loop:

    C:\> for /F %A in (allvariables.txt) do SET %A
    
    0 讨论(0)
提交回复
热议问题