How to Change Processor Affinity in Windows 7
In this article
Yes, you can change processor affinity in Windows 7 without any extra software. Processor affinity controls which CPU cores a running program is allowed to use. By limiting or assigning specific cores to a program, you can stop background tasks from competing with a game or application, or isolate a misbehaving process. The whole job takes about a minute using Task Manager, which is built into every copy of Windows 7.
One thing to know before starting: affinity changes made in Task Manager only apply to the current running session. When you close and reopen the program, Windows resets it to using all cores. To make the setting permanent you need to use the command line tool start /affinity, which is covered below.
What You'll Need
- A Windows 7 PC (any edition, 32-bit or 64-bit)
- An administrator account, or admin credentials, if the process you want to change belongs to the system or another user
- The program you want to change already running
- Nothing to download or install - Task Manager and Command Prompt are built in
Step-by-Step
Exact wording of menus can differ slightly depending on your Windows 7 edition and region, but the steps below apply to all standard installs.
- Launch the program you want to adjust and leave it running.
- Press Ctrl + Shift + Esc to open Task Manager. You can also right-click an empty spot on the taskbar and choose Start Task Manager.
- Go to the Processes tab (or the Applications tab first, then right-click the program and choose Go to Process).
- Right-click the program's process in the list, then click Set Affinity. If you don't see it, click Show processes from all users at the bottom first - some system processes are hidden until you do.
- The Processor Affinity window opens with a checkbox for each CPU core (CPU 0, CPU 1, and so on). All boxes are checked by default, meaning the program may use every core.
- Uncheck the cores you want to block the program from using. For example, to restrict a program to the first two cores of a four-core CPU, uncheck CPU 2 and CPU 3.
- Click OK to apply. The change takes effect immediately - no restart of the program is needed.
- To make the setting permanent, open Command Prompt (click Start, type cmd, press Enter) and launch the program with:
start /affinity 3 "C:\path\to\program.exe". The number is a hex value where each bit stands for one core: 1 = CPU 0 only, 3 = CPU 0 and 1, 5 = CPU 0 and 2, F = all four cores. You can put this command in a shortcut so the program always starts with your chosen cores.
Common Mistakes
- Expecting the change to survive a restart. Task Manager affinity resets when the program closes. Use the
start /affinitycommand if you need it every time. - Restricting a program to a single core unnecessarily. Many modern programs and games are built to spread work across cores. Forcing them onto one core can make them slower, not faster.
- Changing affinity for system processes. Messing with csrss.exe, System, or svchost.exe can freeze or crash Windows. Only change affinity for programs you installed yourself.
- Confusing affinity with priority. Affinity decides which cores a program can use; priority (set via right-click > Set Priority in Task Manager) decides how urgently it runs. They are separate settings.
- Picking the wrong process. Some programs run several processes with similar names. Use the Applications tab and Go to Process to make sure you have the right one.
Tips
- Affinity is most useful for older single-threaded programs that misbehave on multi-core CPUs, or for keeping a heavy task off the cores your game is using.
- Leave at least one core free for Windows itself. If you pin every running process to the same core, the system can become sluggish.
- To undo a change, simply close and reopen the program - affinity returns to all cores by default.
- Check Task Manager's Performance tab while testing to confirm the program is actually using the cores you assigned.
- If you use the
start /affinityshortcut method, wrap the program path in quotes, especially if it contains spaces.
Troubleshooting
The Set Affinity option is greyed out or missing. The process is likely a protected system process, or you lack admin rights. Click Show processes from all users and accept the permission prompt, or log in as an administrator. Some core system processes simply cannot be changed - that is by design.
An error says access is denied. Run Task Manager as administrator: close it, then right-click taskmgr.exe in C:\Windows\System32 and choose Run as administrator. The process may also belong to another user account or be protected by security software.
Only one CPU shows in the affinity window. Either your CPU genuinely has one core (or one core enabled), or the BIOS or power settings have disabled cores. Check your BIOS settings or power plan if you expected more.
The program runs worse after the change. Undo it by reopening the program, then try a less restrictive selection - for example allow two cores instead of one.
The start /affinity command fails. Recheck the hex value (a two-core mask is 3, not 2) and make sure the path to the executable is correct and quoted.
Frequently Asked Questions
Does changing processor affinity permanently damage anything?
No. Affinity is a temporary runtime setting. Restarting the program or the PC restores defaults, and no files are modified.
Will setting affinity make my game run faster?
Usually not, unless the game conflicts with another program on specific cores or has a known multi-core bug. In most cases modern games run best with all cores available.
What is the difference between affinity and priority?
Affinity restricts which CPU cores a process may use. Priority controls how much CPU time it gets compared to other processes. You can change both in Task Manager.
Does affinity work the same on 64-bit Windows 7?
Yes, the Task Manager steps are identical on 32-bit and 64-bit Windows 7. The only difference is the number of CPU checkboxes, which matches your core count.
Can I set affinity for a program before it starts?
Not through Task Manager, since the process must be running. Use the start /affinity command in a shortcut or batch file to launch it with your chosen core mask from the outset.
How many cores can I assign at once?
Any combination you like, from a single core up to all of them. The affinity window shows one checkbox per logical core, including hyper-threaded cores.