title: How to modify Java Control Panel selections (corresponding to deployment.properties file) from windows command prompt?
body: <p><strong>How to modify Java Control Panel selections (corresponding to deployment.properties file) from windows command prompt?</strong>
  Specifically, I am looking for command(s) which can effect change in <code>"Action for local applets"</code> selection, in <code>"Custom Security Level Settings"</code> window <em>(click the "Settings..." button next to "Custom" setting for the "Security Level" slider in the Security tab in Java Control Panel)</em>, from <code>"Prompt user"</code> to <code>"Run without prompt"</code>. 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.</p>
  
  <p>Note, this problem has been discussed recently -- see <a href="https://service.parachat.com/knowledgebase/273/I-see-a-Do-you-want-to-run-this-application-security-warning.html" rel="nofollow">https://service.parachat.com/knowledgebase/273/I-see-a-Do-you-want-to-run-this-application-security-warning.html</a></p>
  
  <p>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.</p>
  
  <p>I found that these security level selections are recorded in Java deployment.properties file and in 2 Windows registry under keys with names ending in <code>"Software\JavaSoft\DeploymentProperties".</code>
  deployment.properties file is discussed comprehensively in <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/deployment/deployment-guide/properties.html" rel="nofollow">Oracle Java SE Documentation "Deployment Configuration File and Properties"</a> but nothing obvious is mentioned about <code>"Action for local applets"</code>, maybe because this property is a recent addition (?)
  When I adjust Java Security Level and <code>"Action for local applets"</code> in the Java Control Panel, I see the changes reflected in the deployment.properties file as well as in the DeploymentProperties registry keys.</p>
  
  <p>So I can do the following:</p>
  
  <ol>
  <li>adjust the deployment.properties file via script <em>(saving the original)</em></li>
  <li>start Java Control Panel via script -- I observed that this copies the updates from the deployment.properties file to the registry keys DeploymentProperties</li>
  <li><p>terminate the javaw process which runs the Java Control Panel</p>
  
  <ul>
  <li>then run the program which uses my local Java applet within IE</li>
  <li>then revert the deployment.properties file to the original, start Java Control Panel via script, and terminate the javaw process which runs the Java Control Panel.</li>
  </ul></li>
  </ol>
  
  <p>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 deployment.properties file! So updating the registry keys is a <em>wrong</em> way to do it.</p>
  
  <p><strong>Is there a better way to do this?</strong> My 3-step solution above (to modify the properties) is a kluge for what it is meant to accomplish. <strong>Is there a Java command-line utility which can modify a given deployment property?</strong> 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?</p>
  
  <p>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.</p>