Windows powershell command to uninstall all versions of Java except a specific version. This command should work in windows 7 & above.
The following command uninstalls all versions. How do I modify the following in such a way that a specific version 8.0.770.3 does not uninstall.
gwmi Win32_Product -filter "name like 'Java%' AND vendor like 'Oracle%' AND (version like '[78].%' OR version like '1.[78].%')" | % { $_.Uninstall() }