Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help please
I try to find code to take backup without using regedit.exe i always found this code

C#
public void ExportKey(string RegKey, string SavePath)
       {
           string path = "\"" + SavePath + "\"";

           string key = "\"" + RegKey + "\"";

           System.Diagnostics.Process proc = new System.Diagnostics.Process();
           try
           {
               proc.StartInfo.FileName = "regedit.exe";
               proc.StartInfo.UseShellExecute = false;
               proc =System.Diagnostics.Process.Start("regedit.exe", "/e " + path + " " + key + "");

               if (proc != null) proc.WaitForExit();
           }
           finally
           {
               if (proc != null) proc.Dispose();
           }

           MessageBox.Show("The export process is complete.\n\nCheck your desktop or the folder that you have specified as your save location.");
       }



I found code in code project Import/Export registry sections as XML[^]
but doesn't work with me
thanks everybody
Posted
Comments
Expert Coming 3-Dec-12 0:02am    
How does that solution not work for you? What errors occur?

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