visual-studiopost-build-eventbuild-events

How can I write a registry key from VS post build event?


One of the projects I work on need to read a registry key in order to determine some value. Usually the value will be written during installation.

Because I want to run the project locally as well (without installation) I want to write that value after the build has finished.

Is there a simple way I can do that?


Solution

  • Searching the web I've found this cool tool that comes with windows called REG.EXE

    Using it from within VS is simple - REG ADD HKLM\SOFTWARE\\ /v NUnitDir /t REG_SZ /d /f