I have a text file:
#deployment.properties
#Thu Dec 22 11:08:21 PST 2016
deployment.modified.timestamp=1482433701009
deployment.roaming.profile=false
deployment.version=8
install.disable.sponsor.offers=false
deployment.cache.enabled=false
deployment.javaws.viewer.bounds=480,186,720,360
deployment.browser.path=C\:\\Program Files\\Internet Explorer\\iexplore.exe
#Java Deployment jre's
#Thu Dec 22 11:08:21 PST 2016
deployment.javaws.jre.1.location=http\://java.sun.com/products/autodl/j2se
deployment.javaws.jre.0.args=
deployment.javaws.jre.0.registered=true
deployment.javaws.jre.1.args=
deployment.javaws.jre.1.enabled=false
deployment.javaws.jre.1.registered=true
deployment.javaws.jre.0.osarch=x86
deployment.javaws.jre.0.osname=Windows
deployment.javaws.jre.1.product=1.6.0_45
deployment.javaws.jre.0.platform=1.8
deployment.javaws.jre.0.path=C\:\\Program Files (x86)\\Java\\jre1.8.0_111\\bin\\javaw.exe
deployment.javaws.jre.0.location=http\://java.sun.com/products/autodl/j2se
deployment.javaws.jre.1.path=C\:\\Program Files (x86)\\Java\\jre6\\bin\\javaw.exe
deployment.javaws.jre.0.enabled=true
deployment.javaws.jre.1.osarch=x86
deployment.javaws.jre.1.osname=Windows
deployment.javaws.jre.1.platform=1.6
deployment.javaws.jre.0.product=1.8.0_111
I need to find the line which contains C\:\\Program Files (x86)\\Java\\jre1.8.0_111\\bin\\javaw.exe
.
On this line I can see that it is .jre.0.enabed =
.
The 0
is important to me because this means it is the first jre
. So now I know 0
means Java 8 and 1
means Java 6. So now I need to go to Java 8 enable
property and mark it as true
and go to Java 6 enabled property and mark it as false
.
I want to do this in a batch file but I am very new to batching. I have found some code to search for lines and modify them, but I need to search for a line here:
C\:\\Program Files (x86)\\Java\\jre1.8.0_111\\bin\\javaw.exe.
And then move back and see what number comes after the jre
. There could also be more than 2 jre
so these number can go say even have 3 (0
, 1
, 2
) etc.