windowsenvironment-variableswindows-xp

How can I export and import environment variables in Windows?


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

I think it should be possible, but how can I do it?


Solution

  • You can use RegEdit to export the following two keys:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
    
    HKEY_CURRENT_USER\Environment
    

    The first set are system/global environment variables; the second set are user-level variables. Edit as needed and then import the .reg files on the new machine.