I’m trying to set a variable:
set pathJDK=%pathDrive%\”Program Files”\Java\jdk\
inside a .bat file but when I execute it, then it responds with an error saying: “Cannot find jdk at C:\”Program Files”\Java\jdk\”
I’ve also tried putting inverted commas on each end of the entire path but same problem.
For some reason it fails with spaces and when you use inverted commas then it fails to ignore them and only use them to escape the spaces.
Is there any way around this?
Try defining
Program Filesas variable:And then