Permanently assigning cores to programs

ChowdhuryOA

Honorable
Sep 19, 2013
1
0
10,510
How do I permanently assign cores to programs? I can set the affinity, but that resets every time I restart the computer. I have a duo core computer.
 

BSim500

Honorable
Apr 6, 2013
269
0
10,960

The only way I know is to create a batch file (eg, notepad.bat) with the following:-

c:\windows\system32\cmd.exe /C start /affinity 1 notepad.exe

(Replace notepad.exe with whatever program (and full path if the batch isn't in same folder)), then make a shortcut to the batch file on the Start Menu, with whatever custom icon you want. "Affinity" will force the program to start by default on the numbered core you have (eg, 1 on Core 1, 3 on Core 3, etc).

The other way of doing it is to use imagecfg, but that modifies the EXE file of the application, which may cause some problems with anti-virus, etc, falsely flagging it as infected. It also causes some newer EXE's to crash. The first method (Batch file) works fine though for most.