How to export and import environment variables in windows?

后端 未结 8 1483
粉色の甜心
粉色の甜心 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: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
    

提交回复
热议问题