There is a bunch of information available that explain how to perform an unattended (aka silent) installation of Java on Windows (examples for JRE and JDK).
What is usually not mentioned is the fact that when you specify a non-standard target directory, it must not contain any spaces. The easiest way to achieve this is the use of the 8.3 format. So instead of “C:\Program Files” you can use “C:\Progra~1”.