On Saturday, 29 August 2015 at 09:44:06 UTC, medhi558 wrote:
I just tried with administrator rights, but it doesn't work.
You need to use a REGSAM value (e.g. KEY_ALL_ACCESS) to open the key with write access:
/////////////////// test.d /////////////////// import std.windows.registry; void main() { auto regKey = Registry.currentUser() .getKey("Software") .getKey("Microsoft") .getKey("Windows") .getKey("CurrentVersion") .getKey("Run", REGSAM.KEY_ALL_ACCESS); regKey.setValue("Calculator", "calc.exe"); } //////////////////////////////////////////////