none
.NET Registry Creator RRS feed

  • Question

  • Hi,

    I have C# WinForm application.

    I want to export my existing registry key entries as .reg file and include in within my WinForm then make my WinForm to create the registry entries wherever I need without having to extract the .reg on the client PC.

    Any suggestion please? How can I achieve this?

    Wednesday, January 21, 2015 8:01 PM

Answers

  • Hello Jassim,

    >>I want to export my existing registry key entries as .reg file and include in within my WinForm

    In .NET, you could export the registry key entries to a .reg file by using the RegSaveKeyEx method referenced it with the P/Invokde way. Or run ps scripts from c# as well by Process class as:

    Process proc = new Process();
    
        try
    
    {    
    
        proc.StartInfo.UseShellExecute = false; 
    
            proc = Process.Start("regedit.exe",”/e File_name.reg regkey_name”);
    
            proc.WaitForExit();
    
        }
    
        catch (Exception)
    
        {
    
            proc.Dispose();
    
    }
    

    >>then make my WinForm to create the registry entries wherever I need without having to extract the .reg on the client PC.

    My understanding for this is that you want to create registry entries in .NET, for this, you could check this link below:

    How to: Create a Key In the Registry (Visual C#)

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 22, 2015 9:02 AM
    Moderator