I've found recently that IF EXIST %ProgramFiles(x86)% and IF EXIST "%PROGRAMFILES(X32)%" only prove the existence of c:\program files (x86), which can exist on a 32 bit machine. I have software that creates its home directory in (x86), and if the directory doesn't exist it creates it. This gives a false positive to the IF EXIST above. I have started using IF EXIST "C:\Windows\SysWOW64" with the hope that some random program won't create this directory on a 32 bit machine.
how can I identify if OS is 32 bit or 64 bit in batch file?
in Application Installs
Posted
I've found recently that IF EXIST %ProgramFiles(x86)% and IF EXIST "%PROGRAMFILES(X32)%" only prove the existence of c:\program files (x86), which can exist on a 32 bit machine. I have software that creates its home directory in (x86), and if the directory doesn't exist it creates it. This gives a false positive to the IF EXIST above. I have started using IF EXIST "C:\Windows\SysWOW64" with the hope that some random program won't create this directory on a 32 bit machine.