Forum Stats

  • 3,815,605 Users
  • 2,259,059 Discussions


command to modify Java Control Panel selections?

985814 Member Posts: 1
How to modify Java Control Panel selections (corresponding to file) from windows command prompt?
Specifically, I am looking for command(s) which can effect change in "Action for local applets" selection, in "Custom Security Level Settings" window (click the "Settings..." button next to "Custom" setting for the "Security Level" slider in the Security tab in Java Control Panel), from "Prompt user" to "Run without prompt"`. This setting's default value changed with update 11 of Java 7 and it interferes with operation of an automated-test program, which I am fixing now, by having a Security Warning dialog window pop-up when IE starts java.exe, unless this Java Control Panel setting is adjusted a priori. This test program launches IE to run a local Java applet, which is written using AWT, and which doesn't access any websites.

Note, this problem has been discussed recently -- see

For my task, modifying this Java Control Panel setting manually is the least desirable way to solve the problem because the program, which I am fixing, is a part of an automated test suite, which is deployed on many machines, and requiring manual intervention makes the deployment process error-prone. I need these commands to run from a windows command prompt batch file.

I found that these security level selections are recorded in Java file and in 2 Windows registry under keys with names ending in `"Software\JavaSoft\DeploymentProperties".` file is discussed comprehensively in but nothing obvious is mentioned about "Action for local applets", maybe because this property is a recent addition (?)
When I adjust Java Security Level and "Action for local applets" in the Java Control Panel, I see the changes reflected in the file as well as in the DeploymentProperties registry keys.

So I can do the following:

1. adjust the file via script (saving the original)
2. start Java Control Panel via script -- I observed that this copies the updates from the file to the registry keys DeploymentProperties
3. terminate the javaw process which runs the Java Control Panel

- then run the program which uses my local Java applet within IE
- then revert the file to the original, start Java Control Panel via script, and terminate the javaw process which runs the Java Control Panel.

I also tried it vice versa -- update the registry key -- but the file does not change and Java Control Panel reverts the registry keys' value set back to agree with the unmodified file! So updating the registry keys is a wrong way to do it.

Is there a better way to do this? My 3-step solution above (to modify the properties) is a kluge for what it is meant to accomplish. Is there a Java command-line utility which can modify a given deployment property? Is there a way to pass these deployment properties to JVM via applet tag's attributes, to be effective only within the given Java applet?

I used Windows XP (both 32-bit and 64-bit) and Windows 7 (64-bit) and Internet Explorer 7, 8 and 9. It would be good to have a (simple) solution which works on Windows XP, Windows Vista, Windows 7 and Windows 8.

Edited by: 982811 on Jan 18, 2013 11:35 AM
This discussion has been closed.