I tested the following on a Windows 8 machine: I inserted a Windows registry key for startup. On Windows XP and Windows 7 that were 32-bit worked but on Windows 8 it's 64-bit did not work. Can someone give me a hand? How to insert a registry key in Windows 8 - 64 bit? Below is the code I've tried.
var
Reg: TRegistry;
S: string;
begin
Reg := TRegistry.Create;
S:= variavelcontendocaminhoearqv;
Reg.rootkey:=HKEY_CURRENT_USER;
Reg.Openkey('software\microsoft\windows\currentversion\run\',true);
Reg.WriteString('programtest',S);
Reg.closekey;
Reg.Free;
end;