I have a Windows Registry file (.REG), which is entered into the Registry when being double clicked.
Now I want to achieve the same result in code with C#. Is there a tool which could convert the REG file into valid C# code doing the same?
I know I could simply keep the REG file and run
regedit /s <file>.reg, so it's basically a one-liner. The point is that I need to adapt the code so it does slightly different things in different circumstances. Basically I want my application to do it, not with Regedit.
- open Registry keys for writing
- create keys
- create REG_DWORD, REG_SZ, REG_EXPAND_SZ
- put the objects into
- support Registry deletion syntax
- ideally writes "clean" code, i.e. introduces variables for long substrings
It would be nice if it's a Visual Studio plugin, but any other solution is probably ok, too, because it will only be used once per REG file.
I have tried: