Use Java 8 - currently you are using a newer version which is not supported for 1.12.2
If you have Java 8 installed, replace the word java (in your script) with the java 8 path (to the javaw.exe)
Put the path into quotation marks - for example:
"C:\Program Files\Java\jre1.8.0_311\bin\javaw.exe" -Xmx3072M -Xms3072M -jar forge.jar
pause
Just make sure the path is correct