Dear friends,
i'd like to execute a reg file from the desktop. With this file, i write some informations to the registry. I know, i can write directly to the registry with:
key.SetValue("Example");
But afterwards, if i want to change some informations, i always need to change to whole program. So i tried:
Process regeditProcess = Process.Start("regedit.exe", @" /S /r C:\Users\example\Desktop\oeminfo.reg");
It starts correctly and asks for permission but when i accepted, nothing happens to the registry. I think there is some problem with the 64 bit Version, because there was the same issue with the RegistryKey method.
Sorry for potential mistakes.
lg Moritz

Guest UserRank #259 · 9.8K reputationPosted Sep 3, 2014, 12:35 AM EDT
regedit.exe /S /r C:\Users\example\Desktop\oeminfo.reg
does it fire perfectly, I mean does it update registry file?
Moritz Gutwein11 reputationPosted Sep 3, 2014, 1:35 AM EDT
Yes it starts as when i double klick it on the desktop. In the next step i have to confirm to write right into the registry. The next window shows "Succesfully writen to registry". But when i refresh the registry, nothing has changed...
Guest UserRank #259 · 9.8K reputationPosted Sep 3, 2014, 6:26 AM EDT
Sorry, one last question when you double click the application or you double click on .reg file above behavior happens?
Moritz Gutwein11 reputationPosted Sep 5, 2014, 1:46 AM EDT
If there are any questions about it, just ask!
Btw. thanks for your help!
Guest UserRank #259 · 9.8K reputationPosted Sep 6, 2014, 1:08 AM EDT
ProcessStartInfo info = new ProcessStartInfo("regedit.exe", @" /S /r C:\Users\example\Desktop\oeminfo.reg");
info.Verb = "runas";
Process.Start(info);
this might pop-up dialog box asking for username/pwd to run this. if you're admin over the machine then it should ideally work?
please try and let me know if this helped you or not.
Moritz Gutwein11 reputationPosted Sep 7, 2014, 11:28 PM EDT
I tried your code snippet. But I get the same result as before. And I dont think it is because of the missing administrator permission. Because I already wrote:
to the app.manifest. And I am not sure if I missed something, but there is sadly no pop-up dialog. Could it be, that it only shows the change after a restart?
Guest UserRank #259 · 9.8K reputationPosted Sep 7, 2014, 11:44 PM EDT
I assume you're logged in as Administrator, but you can try to restart machine. Maybe it helps, but I'm not confident enough.
Moritz Gutwein11 reputationPosted Sep 8, 2014, 12:04 AM EDT
Moritz Gutwein11 reputationPosted Sep 8, 2014, 12:26 AM EDT
Because when I write to the registry via key.SetValue, it looks like this:
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
You see the ending? "Registry64"? Maybe its because of this...
I just dont know how to use it