How to use Registry Windows ?

Rikki Cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 29 02:24:01 PDT 2015


On 29/08/15 9:14 PM, medhi558 wrote:
> Hello,
> I can't seem to use Registry, I tried to many attraction ways but I have
> every time an error "Value cannot be set".
>
>
> Exemple code :
>
> module main;
>
> import std.stdio;
> import std.windows.registry;
>
> void main(string[] args)
> {
>      version(Windows)
>      {
>                   Key registryKey = Registry.localMachine()
>              .createKey("Software")
>              .createKey("Microsoft")
>              .createKey("Windows")
>              .createKey("CurrentVersion")
>              .createKey("Run");
>
>
>          registryKey.setValue("key", "value");
>          }
> }

Humm, try:

auto regKey = Registry.localMachine()
.getKey("Software")
.getKey("Microsoft")
.getKey("Windows")
.getKey("CurrentVersion")
.getKey("Run");

regKey.setValue(...);



More information about the Digitalmars-d-learn mailing list