I need just a little help, with something that seems like it should be easy.
I am creating a simple Windows command line batch file as part of an automated software installation, but I want the script to avoid installing if the script is run on one of the 64 bit versions of windows. Basically I am just looking for a way to detect 64 Windows from within a command line batch file. being able to distinguish between XP and Vista is not necessary, but would be really cool.
Preferably, the method would not have to involve packaging any additional executables, but if that is the only way, I am willing to consider the option. I considered trying to use some of the environmental variables, but I don't really trust that they would be consistent enough across different systems for this purpose, and there aren't very many that are relevant to this anyhow.
I was thinking along the lines of this:
Or maybe this:
I am creating a simple Windows command line batch file as part of an automated software installation, but I want the script to avoid installing if the script is run on one of the 64 bit versions of windows. Basically I am just looking for a way to detect 64 Windows from within a command line batch file. being able to distinguish between XP and Vista is not necessary, but would be really cool.
Preferably, the method would not have to involve packaging any additional executables, but if that is the only way, I am willing to consider the option. I considered trying to use some of the environmental variables, but I don't really trust that they would be consistent enough across different systems for this purpose, and there aren't very many that are relevant to this anyhow.
I was thinking along the lines of this:
Code:
obscurecommand.exe
if errorlevel 1 goto sixfourbit
Code:
if exist "%systemroot%\fileuniqueto64bitwindows.dll" goto sixfourbit