private static void launchElevatedCreation(final String regeditFilePath){
  try {
    final String[] cmd={"cmd","/C","regedit","/s",regeditFilePath};
    final ProcessBuilder processBuilder=new ProcessBuilder(cmd);
    final Process process=processBuilder.start();
    process.waitFor();
  }
 catch (  IOException e) {
    logger.warn("Running regedit encountered an IOException: {}",e.getMessage());
  }
catch (  Exception e) {
    logger.warn("Waiting for the process to execute resulted in an error: " + e.getMessage());
  }
}

private static void launchElevatedCreation ( final String regeditFilePath ) { try { final String [ ] cmd = { "cmd" , "/C" , "regedit" , "/s" , regeditFilePath } ; final ProcessBuilder processBuilder = new ProcessBuilder ( cmd ) ; final Process process = processBuilder . start ( ) ; process . waitFor ( ) ; } catch ( IOException e ) { logger . warn ( "Running regedit encountered an IOException: {}" , e . getMessage ( ) ) ; } catch ( Exception e ) { logger . warn ( "Waiting for the process to execute resulted in an error: " + e . getMessage ( ) ) ; } }
run script to launch elevated process to create registry keys
