Displays, sets, or removes Windows environment variables.
Set a Windows 8.3 Pathname
set JAVA_HOME=c:\Progra~1\Java\jdk1.8.0_45
REM NOT
REM SET JAVA_HOME="C:\Program Files\Java\jdk1.8.0_45"
You need to use the Windows 8.3 Pathname notation. See windows_path