Hello to all,
I am trying to write a simple batch file to install an AV on multiple machines. I am not an experienced batch file writer, but try to adapt scripts others have written. Sometimes this takes me down the wrong path...
What I am trying to accomplish:
Have the batch identify 32bit versus 64bit machines then use PSexec to run the appropriate msi file to install the AV program on multiple computers listed in a txt file. Here is my approch:
REM Check Windows Architecture
PsExec.exe @c:\AVinstall\AVcomputerlist.txt -s cmd /c wmic os get osarchitecture | findstr /i "32-bit" > nul | IF %ERRORLEVEL% EQU 0 (goto :os_32) ELSE (goto :os_64)
:os_32
PsExec.exe -s msiexec.exe -i "\\SERVER\AVinstall\AVmsi\Sep.msi" /quiet
PsShutdown -c -t 180 -r -m "Your Antivirus software has been updated - PC will reboot in 3 minutes - Save and close any open programs"
goto end
:os_64
PsExec.exe -s msiexec.exe -i "\\SERVER\AVinstall\AV64msi\Sep64.msi" /quiet
PsShutdown -c -t 180 -r -m "Your Antivirus software has been updated - PC will reboot in 3 minutes - Save and close any open programs"
goto end
:end
PAUSE
This may be the entirely wrong approach.
Problems...
- The WMIC command to determine if 32 or 64 bit does not seem to work on some machines.
- The script seems to only run the sub routine once (rather than looping back to do the next computer in the txt file list
Any assistance would be greatly appreciated.
THANKS!
Tim