I have a back up application that I wrote and I need it to run on start up, always for all users. I want to use
key := '\Software\Microsoft\Windows\CurrentVersion\Run';
Reg := TRegIniFile.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.CreateKey(Key);
if Reg.OpenKey(Key,False) then Reg.WriteString(key, 'Backup', 'c:\backup.exe');
finally
Reg.Free;
end;
I have written a manifest and added it as a resource, It asks for admin privileges every time it runs. However, it is not adding the the reg value and I am not sure why.