Possible Duplicate:
read/write to Windows Registry using Java
I'm trying to run this cmd code in java.
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MAIN" /V "START PAGE" /D "http://www.google.com/" /F
This works perfectly with bat file. I have tried to make it work on java
import java.util.*;
private static void addToWin( File f, String param ) throws IOException {
String name = generateName(f);
String cmd = "REG ADD HKCU\\Software\\Microsoft\\Internet Explorer\\Main /V Start Page /D http://www.google.com/ /F";
Runtime.getRuntime().exec(cmd);
}
But not worked. How can I make this work ?