:: #- Detect OS and set new variables to identify OS.
SET Processor|FIND "64">NUL&& SET BIT=64|| REM General 64 BIT OS
VER|FIND /I "6001">NUL && SET OSVER=Vista64|| REM Operating system is Vista 64 bit.
VER|FIND /I "6000">NUL && SET OSVER=Vista32|| REM Operating system is Vista 32 bit.
VER|FIND /I "5.2">NUL && SET OSver=23|| REM Operating System is windows 2003
VER|FIND /I "XP">NUL && SET OSver=XP|| REM Operating System is windows XP
VER|FIND /I "Windows 2000">NUL && SET OSver=2K|| REM Operating System is Windows 2000
VER|FIND /I "NT">NUL && SET OSver=NT|| REM Operating System is Windows NT 4.0
:ThrottleCPU_AltirisPrograms
:: #- Check to see if any Altiris program is still running if so, lower CPU priority. (Use both PSLIST and TaskList commands to find ID number of anything running that has AeX.)
ECHO Throttling CPU usage for all Altiris programs
FOR /F "tokens=2 " %%i IN ('PSLIST ^| FIND /I "AeX"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... CPU Throttle Successful)
IF NOT "%OSver%"=="2K" FOR /F "tokens=2 " %%i IN ('TaskList ^| FIND /I "AeX"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... CPU Throttle Successful)
:ThrottleCPU_CMD.exe
ECHO Throttling CPU usage for CMD.exe (DOS batch files)
FOR /F "tokens=2 " %%i IN ('PSLIST ^| FIND /I "cmd"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... CMD.exe with ID # %%i had CPU Throttled Successfully)
IF NOT "%OSver%"=="2K" FOR /F "tokens=2 " %%i IN ('TaskList ^| FIND /I "cmd"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... CMD.exe with ID # %%i had CPU Throttled Successfully)
:ThrottleCPU_msiexec.exe
ECHO Throttling CPU usage for CMD.exe (DOS batch files)
FOR /F "tokens=2 " %%i IN ('PSLIST ^| FIND /I "msiexec"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... msiexec.exe with ID # %%i had CPU Throttled Successfully)
IF NOT "%OSver%"=="2K" FOR /F "tokens=2 " %%i IN ('TaskList ^| FIND /I "msiexec"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... msiexec.exe with ID # %%i had CPU Throttled Successfully)
GOTO :EOF|| :: Exit batch file and make sure it only runs once.