Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi all
I'm totally new in C#
I have two AutoCAD registry key I want to merge them at once without user confirmation message
for example those two files called
PS.reg
TF.reg
how could I do this ..

What I have tried:

Microsoft.Win32.RegistryKey key;
 private void bunifuFlatButton1_Click(object sender, EventArgs e)
 {
     key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("TFSP");
     key.SetValue("TEST", "YES");
     key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("TEST");
     key.SetValue("TEST1", "YES");

     key.Close();
     MessageBox.Show("fixed");

 }
Posted
Updated 28-Mar-17 5:02am
v2
Comments
Richard MacCutchan 27-Mar-17 10:34am    
Just double click on each file and they will be merged into the registry. But be aware that adding invalid items to the registry can lead to serious problems with your system.
ZurdoDev 27-Mar-17 14:18pm    
Google how to write to registry using c#.
PIEBALDconsult 28-Mar-17 11:03am    
The /s or -s Regedit commands can be added to the command to suppress the confirmation box "Are you sure want to add the information in hope.reg to the Registry?" when running the command at the command line. For example, using the same command used earlier you can type: Regedit /s hope.reg and have that Registry file immediately imported into the Registry.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900