hai, Iam tryng to write installation for an application,which require to set some persistent system environment variables using java program. I have tried using set command Runtime.getRuntime().exec("cmd /c set blah blah "),but this applies only to that particular DOS promt only,i presume.And this is not perisistent.please do help. Biju
Do these values need to be global for the whole system? What if you happen to choose a variable name that is already in use? I suggest that you create a .properties file and use the Properties class to store these values instead. That way they are local to your own program and don't interfere with any global settings that are necessary for the computer to run. Also, this approach will make your software independent of the operating system. The approach you are using now is specific to Windows.
Mr Stefan Wagner iam working in windows 2000 env and i dont think there is any autoexec.bat file in window 2003. Any way i got a break through.Thanks for tour reply. Biju Mr Barry Gaunt, i think Java's Preferences can set values to HKEY_LOCAL_MACHINE/JavaSoft/Prefs only ,it can't environment variables.please read the question carefully.Thank you Biju