P
paul brown
Hi
i'm trying to update my registry from Java (ugly, i know!)
i'm doing this:
public class Registry{
public static void main(String[] args){
try{
Process proc =
Runtime.getRuntime().exec(
new String[]{"cmd",
"/C",
"regedit"+
"/S"+
Registry.REGFILE});
proc.waitFor();
proc.destroy();
}
catch(Throwable th){
th.printStackTrace();
}
}
public static String REGFILE ="regfile.reg";
}
The problem is that when i run the program the registry doesnt get updated.
regedit.exe is on the path of the program.
The registry file is in the working directory of the program.
If i run the 'regedit' command by hand , from a DOS box, using the same
registry file, it works.
Any ideas?
Thanks in advance,
Paul
i'm trying to update my registry from Java (ugly, i know!)
i'm doing this:
public class Registry{
public static void main(String[] args){
try{
Process proc =
Runtime.getRuntime().exec(
new String[]{"cmd",
"/C",
"regedit"+
"/S"+
Registry.REGFILE});
proc.waitFor();
proc.destroy();
}
catch(Throwable th){
th.printStackTrace();
}
}
public static String REGFILE ="regfile.reg";
}
The problem is that when i run the program the registry doesnt get updated.
regedit.exe is on the path of the program.
The registry file is in the working directory of the program.
If i run the 'regedit' command by hand , from a DOS box, using the same
registry file, it works.
Any ideas?
Thanks in advance,
Paul