Start Your Game Or Browser With As Many Cores As You Want.

Start Your Game Or Browser With As Many Cores As You Want.

  • Hi there and welcome to PC Help Forum (PCHF), a more effective way to get the Tech Support you need!
    We have Experts in all areas of Tech, including Malware Removal, Crash Fixing and BSOD's , Microsoft Windows, Computer DIY and PC Hardware, Networking, Gaming, Tablets and iPads, General and Specific Software Support and so much more.

    Why not Click Here To Sign Up and start enjoying great FREE Tech Support.

    This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Welcome to our Community
Wanting to join the rest of our members? Feel free to sign up today.
Sign up
To start any executable file (.exe) with as many cores as you want, you can follow these detailed steps. This guide will walk you through the process of setting CPU affinity for an application, ensuring it utilizes multiple cores effectively.

To start you will want to find out how many cores you have on your computer, you can do this by doing the following:​


Open Command prompt as admin:
Then copy and paste the command below and hit enter.
wmic cpu get NumberOfCores, NumberOfLogicalProcessors /Format:List >"%userprofile%\desktop\cores.txt"
A text file named cores will be saved to your desktop.

Then you will want to create a PowerShell Script to start your program.​


Here I have set FireFox to start with all 8 cores.

After Affinity the ff and in " " marks I have the file path to firefox.

Code:
# Elevate to Administrator if not already running as admin
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
    Start-Process powershell.exe "-ExecutionPolicy Bypass -File $PSCommandPath" -Verb RunAs
    Exit
}

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe" -ArgumentList "-affinity", "ff"

Use a Binary to Hexadecimal Converter to get the Hex number which represents the number of Cores.​


Use this Binary to Hexadecimal Converter, you must enter the number of cores you want to use by add 1 however many times to represent the number of cores, you can not just put in 7 you must enter seven 1's into the converter in order for it to work.

So if I wanted to use 6 cores for a program the Hex would be 3F

So this is how you set things up:​


Start-Process -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe" -ArgumentList "-affinity", "ff"


Area in green represents the file you want to start, and the yellow represents how many cores you want the program to run with.

To get any file path:​


Download and install Everything Search Engine:
Then search the name of your game or program you want to add.
Find the .exe of the program that you searched up.
Left click it once to select it.
Right Click and Copy Full Name To Clipboard.
After you copied the file path.
Then paste it into the area where the green is, do not remove the quote marks or this will not work.
Then use the Binary to Hex converter paste the Hexadecimal value in the yellow area.
Also make sure to stay in the quotes.

Put it all together.​

# Elevate to Administrator if not already running as admin
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
Start-Process powershell.exe "-ExecutionPolicy Bypass -File $PSCommandPath" -Verb RunAs
Exit
}

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe" -ArgumentList "-affinity", "ff"


Open notepad and then copy and paste the text in the box above:
You will then save it as whatever you want, so long as it has .ps1 at the end.
This will be a shortcut for starting that particular program with as many cores as you desire.
I named this one firefox.ps1

That's it you now know how to start any program you want with as many cores as you want, this could be helpful with games, or you could use it for any power hungry applications that you wish.
Author
Malnutrition
Views
161
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Malnutrition