Skip to main content

Change JAVA settings using batch file

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2013-06-16
Points: 0

Hi All,
The subject is very simple. I want to create a batch file which will be runned on user account manually. Batch should perform two changes in JAVA configuration.

1. Switch to disable and the command for this is : "javaws -userConfig disable"

2.Import a certificate previously exported from my PC. Below command that I have used for the purpose:

"C:\Program Files\Java\jre7\bin\keytool" -importcert -file "V:\Filename.crt" -keystore "%userprofile%\appdata\LocalLow\sun\java\deployment\security\trusted.certs" -storepass "123456" -noprompt

It sounds simple. Batch is changing those options and I see those changes, but OS is acting like the changes were never made.I must run the application via control panel and make the change from that level. How is it possible ?

Below information about the Java version:

java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)

This happens on Win7 and XP (x64 and x86)

Any ideas?

Thanks in advance for any reply.