Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
click button to export .reg file
from: ComputerName\HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Test1

to application patch, or another place from my computer....

What I have tried:

I searched the internet but I did not find anything
Posted
Updated 23-May-19 7:30am

1 solution

Here is the c# equivalent, so you could convert to vb.net should you desire.There are plenty other examples on the net.

C#
private static void Export(string exportPath, string registryPath)
{ 
    string path = "\""+ exportPath + "\"";
    string key = "\""+ registryPath + "\"";
    Process proc = new Process();

    try
    {
        proc.StartInfo.FileName = "regedit.exe";
        proc.StartInfo.UseShellExecute = false;

        proc = Process.Start("regedit.exe", "/e " + path + " "+ key);
        proc.WaitForExit();
    }
    catch (Exception)
    {
        proc.Dispose();
    }
}


Source: command line - How to export a registry in c# - Stack Overflow[^]
 
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