Hello, all
Ok, I have been working on a batch script to copy some files into a certain directory on a lot of computers. The one problem I am having is that most of the computers are 32-bit, but there are a few 64-bit OSs. What I am trying to do it set up a variable that is set to either Programfiles or Programfiles (x86), depending on whether it is 32 ot 64-bit. This way I would not have to keep updating two batch files, and would only need to worry about one of them.
The following is the script that I tried, but can't seem to make work, any suggestions?
IF %PROCESSOR_ARCHITECTURE%==x86 GOTO 32bit ELSE IF %PROCESSOR_ARCHITECTURE%==AMD64 GOTO 64bit
:32bit
SET ProgFiles=%ProgramFiles%
GOTO Continue
:64bit
SET ProgFiles=%ProgramFiles(x86)%
GOTO Continue
:Continue
For some reason when I run it on a 64bit and it fails, I go and look back at that line and it says:
IF AMD64==x86 GOTO 32bit ELSE IF AMD64==AMD64
SET ProgFiles=%ProgramFiles%
Thanks in advance!
Ok, I have been working on a batch script to copy some files into a certain directory on a lot of computers. The one problem I am having is that most of the computers are 32-bit, but there are a few 64-bit OSs. What I am trying to do it set up a variable that is set to either Programfiles or Programfiles (x86), depending on whether it is 32 ot 64-bit. This way I would not have to keep updating two batch files, and would only need to worry about one of them.
The following is the script that I tried, but can't seem to make work, any suggestions?
IF %PROCESSOR_ARCHITECTURE%==x86 GOTO 32bit ELSE IF %PROCESSOR_ARCHITECTURE%==AMD64 GOTO 64bit
:32bit
SET ProgFiles=%ProgramFiles%
GOTO Continue
:64bit
SET ProgFiles=%ProgramFiles(x86)%
GOTO Continue
:Continue
For some reason when I run it on a 64bit and it fails, I go and look back at that line and it says:
IF AMD64==x86 GOTO 32bit ELSE IF AMD64==AMD64
SET ProgFiles=%ProgramFiles%
Thanks in advance!