Counter-Strike 2

Counter-Strike 2

View Stats:
Pap En Tik Nov 12, 2023 @ 3:27pm
How to set CPU priority and affinity for cs2 or any other game on Steam using command prompt and Steam launch options
UPDATED: Use powershell instead, here's my guide: https://steamcommunity.com/app/730/discussions/0/4309453299234987087/

In this example I'll be disabling core 0 and setting priority to above normal but you can set your own priorities and affinities by replacing "abovenormal" and "FE" in the command line, you can also calculate your own CPU affinities on this site if you want:

https://bitsum.com/tools/cpu-affinity-calculator/

To insert your own affinities, simply calculate the hex value in the site above (You can ignore all the zeros to the left of your calculated value) and replace the "FE" in the command line in the steps below.

____________________________________

Step 1. Open Notepad and paste this command line into there: cmd /c start "" /abovenormal /affinity FE "programfilepath.exe"

Step 2. Find the location of your Steam game and copy the path of the .exe file (Mine is "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2.exe").

Step 3. Paste the path of the Steam game you just copied into the command line that you created in Step 1, replacing "programfilepath.exe" as that's just an example, make sure to include the quotation marks, it should look like this:

cmd /c start "" /abovenormal /affinity FE "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2.exe"

Step 4 <CRUTIAL STEP> Once your command is set up in Notepad you'll need to save it as a batch file, click "File", "Save as", and change your "Save as type" from "Text documents(*.txt)" to "All files", name your file whatever you want but make sure it has .bat at the end of the name, save or move the batch file to your game's directory in the same folder where your game's .exe file is located.

Step 5. Once your batch file is in the game's directory, copy the path of that batch file and paste it into the game's Steam launch options followed by %COMMAND% with a space between, your launch options should look like this:

"C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2 bat.bat" %COMMAND%

Step 6. Launch the game and have fun, hopefully it works for you!

P.S. to revert these changes, all you need to do is remove the launch options from your game and delete the .bat file.
Last edited by Pap En Tik; Mar 5, 2024 @ 1:20pm
< >
Showing 1-15 of 17 comments
Vault Hunter 101 Nov 12, 2023 @ 3:35pm 
You know you can do that in task manager, right?
Pap En Tik Nov 13, 2023 @ 12:14am 
Originally posted by Vault Hunter 101:
You know you can do that in task manager, right?
You really think I'd learn and type all this out if I didn't know that? The reason for this is so that you don't have to do exactly that
Originally posted by Pap en tik:
In this example I'll be disabling core 0 and setting priority to above normal but you can set your own priorities and affinities by replacing "abovenormal" and "FE" in the command line, you can also calculate your own CPU affinities on this site if you want:

https://bitsum.com/tools/cpu-affinity-calculator/

To insert your own affinities, simply calculate the hex value in the site above (You can ignore all the zeros to the left of your calculated value) and replace the "FE" in the command line in the steps below.

____________________________________

Step 1. Open Notepad and paste this command line into there: C:\Windows\System32\cmd.exe /c start "" /abovenormal /affinity FE "programfilepath.exe"

Step 2. Find the location of your Steam game and copy the path of the .exe file (Mine is "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2.exe").

Step 3. Paste the path of the Steam game you just copied into the command line that you created in Step 1, replacing "programfilepath.exe" as that's just an example, make sure to include the quotation marks, it should look like this:

C:\Windows\System32\cmd.exe /c start "" /abovenormal /affinity FE "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2.exe"

Step 4 <CRUTIAL STEP> Once your command is set up in Notepad you'll need to save it as a batch file, click "File", "Save as", and change your "Save as type" from "Text document(*.txt)" to "All files", name your file whatever you want but make sure it has .bat at the end of it, save the batch file to your game's directory in the same folder as the .exe file.

Step 5. Once your batch file is in the game's directory, copy the path of that batch file and paste it into the game's Steam launch options followed by %COMMAND% with a space between, it should look like this:

"C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2 bat.bat" %COMMAND%

Step 6. Launch the game and have fun, hopefully it works for you!

Thanks <3
Zero Nov 13, 2023 @ 12:28am 
Does this improve CS2's performance noticeably? I was sus of priority changes doing anything useful because it's so "simple" but then I heard of people getting higher benchmarks and stuff so idk anymore...
PKS Nov 13, 2023 @ 12:29am 
.
Pap En Tik Nov 13, 2023 @ 12:35am 
Originally posted by Zero:
Does this improve CS2's performance noticeably? I was sus of priority changes doing anything useful because it's so "simple" but then I heard of people getting higher benchmarks and stuff so idk anymore...
The priority is less important than the affinity, I gain an extra 10-20 fps when I disable core 0 as that's the core the OS does all of its tasks on. Before attempting this, open your game and task manager, go into the details tab and there you can check affinities and priorities but anything you do there is not permanent, that's where this guide comes in. If you gain fps from disabling core 0, then follow these steps so you won't have to repeat it every time.
Pap En Tik Nov 13, 2023 @ 12:41am 
Originally posted by cur1ousss #liveOnYT:
Originally posted by Pap en tik:
In this example I'll be disabling core 0 and setting priority to above normal but you can set your own priorities and affinities by replacing "abovenormal" and "FE" in the command line, you can also calculate your own CPU affinities on this site if you want:

https://bitsum.com/tools/cpu-affinity-calculator/

To insert your own affinities, simply calculate the hex value in the site above (You can ignore all the zeros to the left of your calculated value) and replace the "FE" in the command line in the steps below.

____________________________________

Step 1. Open Notepad and paste this command line into there: C:\Windows\System32\cmd.exe /c start "" /abovenormal /affinity FE "programfilepath.exe"

Step 2. Find the location of your Steam game and copy the path of the .exe file (Mine is "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2.exe").

Step 3. Paste the path of the Steam game you just copied into the command line that you created in Step 1, replacing "programfilepath.exe" as that's just an example, make sure to include the quotation marks, it should look like this:

C:\Windows\System32\cmd.exe /c start "" /abovenormal /affinity FE "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2.exe"

Step 4 <CRUTIAL STEP> Once your command is set up in Notepad you'll need to save it as a batch file, click "File", "Save as", and change your "Save as type" from "Text document(*.txt)" to "All files", name your file whatever you want but make sure it has .bat at the end of it, save the batch file to your game's directory in the same folder as the .exe file.

Step 5. Once your batch file is in the game's directory, copy the path of that batch file and paste it into the game's Steam launch options followed by %COMMAND% with a space between, it should look like this:

"C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\cs2 bat.bat" %COMMAND%

Step 6. Launch the game and have fun, hopefully it works for you!

Thanks <3
Happy to help!
Zero Nov 13, 2023 @ 12:48am 
Originally posted by Pap en tik:
Originally posted by Zero:
Does this improve CS2's performance noticeably? I was sus of priority changes doing anything useful because it's so "simple" but then I heard of people getting higher benchmarks and stuff so idk anymore...
The priority is less important than the affinity, I gain an extra 10-20 fps when I disable core 0 as that's the core the OS does all of its tasks on. Before attempting this, open your game and task manager, go into the details tab and there you can check affinities and priorities but anything you do there is not permanent, that's where this guide comes in. If you gain fps from disabling core 0, then follow these steps so you won't have to repeat it every time.
I mean the affinity is conceptually kinda similar to priority isn't it? Maybe increase the priority even more.

I will try this on my new gaming build after all of my parts arrive and I've finished all the overclocking and stress testing.
Right now I'm too lazy to rice up my potato any more because it'd involve comprehensively testing every single map. The gaming build is going to be riced to the absolute maximum though :)
Pap En Tik Nov 13, 2023 @ 12:59am 
Originally posted by Zero:
Originally posted by Pap en tik:
The priority is less important than the affinity, I gain an extra 10-20 fps when I disable core 0 as that's the core the OS does all of its tasks on. Before attempting this, open your game and task manager, go into the details tab and there you can check affinities and priorities but anything you do there is not permanent, that's where this guide comes in. If you gain fps from disabling core 0, then follow these steps so you won't have to repeat it every time.
I mean the affinity is conceptually kinda similar to priority isn't it? Maybe increase the priority even more.

I will try this on my new gaming build after all of my parts arrive and I've finished all the overclocking and stress testing.
Right now I'm too lazy to rice up my potato any more because it'd involve comprehensively testing every single map. The gaming build is going to be riced to the absolute maximum though :)
Affinity is letting Windows know how many cores a given application is allowed to use, unchecking core 0 usually nets you a few fps as that is the core that gets clogged up by the operating system, priority is just letting Windows know which tasks will get resources first when the system is under heavy load so it's more situational than affinity is. If you're building a new PC that has a CPU with loads of cores, let's say 16 or more, you may even benefit from disabling more than just core 0 in certain games, this is known as disabling hyperthreading. But that's very much game-dependant.
76561199149692366 Nov 13, 2023 @ 1:18am 
thanks for your instructions but I am confused and give up
Pap En Tik Nov 13, 2023 @ 1:20am 
Originally posted by Lobotomized:
thanks for your instructions but I am confused and give up
Let me know what you are confused about and maybe I can help you, trust me, I was confused about this as well but once you get it you realise just how easy it is.
76561199149692366 Nov 13, 2023 @ 2:01am 
Originally posted by Pap en tik:
Originally posted by Lobotomized:
thanks for your instructions but I am confused and give up
Let me know what you are confused about and maybe I can help you, trust me, I was confused about this as well but once you get it you realise just how easy it is.
A video link would be easier for me understand. Thanks
Pap En Tik Nov 13, 2023 @ 2:07am 
Originally posted by Lobotomized:
Originally posted by Pap en tik:
Let me know what you are confused about and maybe I can help you, trust me, I was confused about this as well but once you get it you realise just how easy it is.
A video link would be easier for me understand. Thanks
I don't even think there are videos on this exact method, you might find one but it'll be waaay down in the search results. I've tried my best to make this guide as simple as possible so if there's something that's confusing you please let me know so that I can update my guide to make it easier.
Spray Mar 4, 2024 @ 4:36pm 
doesn't work anymore, valve detects bat file in game directory, asks to remove it.
Pap En Tik Mar 5, 2024 @ 1:19pm 
Originally posted by Spray:
doesn't work anymore, valve detects bat file in game directory, asks to remove it.
Here's a new post of mine showing how to change affinity and priority with powershell instead (it's better) https://steamcommunity.com/app/730/discussions/0/4309453299234987087/
< >
Showing 1-15 of 17 comments
Per page: 1530 50

Date Posted: Nov 12, 2023 @ 3:27pm
Posts: 17