home *** CD-ROM | disk | FTP | other *** search
/ ftp2.jacobs.com / 2015.02.ftp2.jacobs.com.tar / ftp2.jacobs.com / altiris.exe / ThrottleCPU.cmd < prev    next >
OS/2 REXX Batch file  |  2010-08-16  |  2KB  |  28 lines

  1. @ECHO OFF
  2.  
  3.     :: #- Detect OS and set new variables to identify OS.
  4. SET Processor|FIND "64">NUL&&        SET BIT=64||        REM General 64 BIT OS
  5. VER|FIND /I "6001">NUL &&         SET OSVER=Vista64||    REM Operating system is Vista 64 bit.
  6. VER|FIND /I "6000">NUL &&         SET OSVER=Vista32||    REM Operating system is Vista 32 bit.
  7. VER|FIND /I "5.2">NUL &&        SET OSver=23||        REM Operating System is windows 2003
  8. VER|FIND /I "XP">NUL &&            SET OSver=XP||        REM Operating System is windows XP
  9. VER|FIND /I "Windows 2000">NUL &&    SET OSver=2K||        REM Operating System is Windows 2000
  10. VER|FIND /I "NT">NUL &&            SET OSver=NT||        REM Operating System is Windows NT 4.0
  11.  
  12. :ThrottleCPU_AltirisPrograms
  13.     :: #- 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.)
  14.    ECHO Throttling CPU usage for all Altiris programs
  15.                FOR /F "tokens=2 " %%i IN ('PSLIST ^| FIND /I "AeX"') DO (SetPriority.exe -p16384 -t-2 %%i&& ECHO ... CPU Throttle Successful)
  16.    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)
  17.  
  18. :ThrottleCPU_CMD.exe
  19.    ECHO Throttling CPU usage for CMD.exe (DOS batch files)
  20.                   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)
  21.    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)
  22.  
  23. :ThrottleCPU_msiexec.exe
  24.    ECHO Throttling CPU usage for CMD.exe (DOS batch files)
  25.                   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)
  26.    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)
  27.  
  28. GOTO :EOF||                            :: Exit batch file and make sure it only runs once.