Originally Posted by PeterT
You could use the PROCESSOR_ARCHITECTURE variable to see if this is 64 bit or 32 bit OS; AMD64 or IX86.
The comments output by the batch file are a bit misleading...
On a 64 bit Windows, 32 bit Java is in %ProgramFiles(x86)%\Java\ and 64 bit Java in %ProgramFiles%\Java\
The comments should be correct now! The previous version of the batch file would have worked on a 32-bit machine with 32-bit Java or a 64-bit machine with 64-bit Java. The errors are on the paths where it is 32-bit Java on a 64-bit machine. As I do not have a 64-bit machine this is not something I can test directly so have been trying to simulate.
Your idea of using the PROCESSOR_ARCHITECTURE variable is interesting. I will have to see how it varies across different environments to see if it is actually useful in this particular case. If nothing else I think it might be a good idea for the comments output by the rungui.cmd file to give its value for any future trouble-shooting.