Process Builder JAVA. :
ProcessBuilder processBuilder = new ProcessBuilder("regedit", "reg_file_to_run.reg");
Process processToExecute = processBuilder.start();
:
processToExecute.waitFor();
Note. If a command in the registry file asks for confirmation when making changes to the registry entries, you can also execute it using the "/ s" option. Like this:
ProcessBuilder processBuilder = new ProcessBuilder("regedit", "/s", "reg_file_to_run.reg");
This command will be executed without any confirmation prompts.
source
share