Hi guys,
I need to install a .reg file (INTRANET) by using Java. How do i get my goal ?
Cheers,
Hi guys,
I need to install a .reg file (INTRANET) by using Java. How do i get my goal ?
Cheers,
You could use System.exec to launch regedit yourfile.reg
Here is how to do it :
String[] cmd = {"regedit", "yourfile.reg"};
Process p = Runtime.exec(cmd);
p.waitFor();
Last line is optional, it only allows you to wait until the operation is over.
If you're already on Java 1.6, just grab java.awt.Desktop
:
Desktop.getDesktop().open(new File("c:/yourfile.reg"));
It will launch the file using the default application associated with it, as if you're doubleclicking the particular file in Windows explorer.