C# - Import reg file to the registry without user confirmation box

c#, registry

Solution

Send the file as a parameter to `regedit.exe`:

Process regeditProcess = Process.Start("regedit.exe", "/s key.reg");
regeditProcess.WaitForExit();

Problem

C# winforms - How can I import a `reg` file into the registry? The following code is displaying a confirmation box to the user (yes/no). ``` Process regeditProcess = Process.Start("key.reg", "/S /q"); // not working regeditProcess.WaitForExit(); ```

Original source