Add registry export to registry with Process.Start() without a message box popping up

aewarnick

Senior Contributor
Joined
Jan 29, 2003
Messages
1,031
The was a way to do that in batch files, how can I do it in C#?

If you double click on a reg export you get the message box that says, "Are you sure you want to add ... to the registry?". And then the confirmation that it is done.

How can I stop those from popping up and just accept it?
 
Have a look at the static Microsoft.Win32.Registry class for
registry access and manipulation:

[mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfmicrosoftwin32registryclasstopic.htm[/mshelp]
 
I know how to write to the registry with pure C# code with no outside files but what I mean is how to import a .reg file without that confirmation coming up.
 
Well if you can do it with batch files, then have your program
create the batch file, run it with Process.Start(), and then delete
the batch file.
 
Back
Top