none
Tasklist to find and set priority to processes RRS feed

  • Question

  • Hello, I have a script that runs a game on high priority and after it sets some others to low priority. But some lines doesn't work.

    start "" /high "D:\Steam\steamapps\common\Counter-Strike Global Offensive\csgo.exe"
    echo off
    
    tasklist /fi "imagename eq Discord.exe" |find ":" > nul
    if %ERRORLEVEL% LEQ 1 CALL setpriority 16384  /im "Discord.exe"
    
    
    tasklist /fi "imagename eq Steam.exe" |find ":" > nul
    if %ERRORLEVEL% LEQ 1 CALL setpriority 16384  /im "Steam.exe"
    
    
    tasklist /fi "imagename eq SteamService.exe" |find ":" > nul
    if %ERRORLEVEL% LEQ 1 CALL setpriority 16384  /im "Steam.exe"
    
    
    tasklist /fi "imagename eq steamwebhelper.exe" |find ":" > nul
    if %ERRORLEVEL% LEQ 1 CALL setpriority 16384  /im "Steam.exe"
    
    
    exit

    The game starts at high priority but the next lines that set the priority for the other processes doesn't work. Any suggestion what the syntax is?

    Thank you for your time



    • Edited by WantedStarling Sunday, January 27, 2019 4:29 PM
    • Moved by Bill_Stewart Friday, March 15, 2019 6:34 PM Unanswerable drive-by question
    Sunday, January 27, 2019 4:28 PM

All replies

  • I will just say that you don't want to do this.

    The batch file is incomplete.

    We do not fix scripts you have found on the Internet.  Ask your game vendor for help with this.


    \_(ツ)_/


    • Edited by jrv Sunday, January 27, 2019 5:56 PM
    Sunday, January 27, 2019 5:56 PM
  • I haven't found any script on the Internet. I found the commands on the Internet and tried to make the script by myself.
    Sunday, January 27, 2019 11:11 PM
  • There is no such command as "setproirity".

    Unless you truly understand what you are doing you should not alter priority.  Actually in many cases Windows will just override the priority.


    \_(ツ)_/

    Sunday, January 27, 2019 11:24 PM