I'm working on several Windows computers (mostly Win7) and like to carry my configuration around with me. That configuration is mostly development stuff, like: Where is the main Mercurial repo on my computer? Where are the JAR files? Where is Cygwin?
In order to decouple various tools and scripts from the exact location of such things, I point them to environment variables, which I then have to set up for each machine, of course.
As I maintain all my important configuration settings (like for Vim) in Mercurial, I'd like to put the environment variables there as well. In order for this to happen, I need a simple text file representation for editing that ideally I could import per double click into the registry, which is where Windows environment variables reside.
HKEY_CURRENT_USER\Environment
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
My first idea was of course to use regedit
and just export the relevant keys to sys-env.reg
and usr-env.reg
. I would then be able to weed out the stuff I wouldn't need to edit, do the edits I want to do, and re-import the environement, and done.
And it works indeed. There's only one problem. A registry type value of REG_EXPAND_SZ
is exported as an unreadable and uneditable text representation the underlying binary format (whatever it is).
Hence the question: Does anyone know a better text format for the purposes described above, notably editing? (If not, this is as good as it gets, and I'm already 90 % there, so it's good enough.)
Before you suggest that, I know about the excellent Rapid Environment Editor, and I'm actually using it a lot, but this is not what I'm looking for right here.
.reg
files for backwards compatibility.