How do I permanently set the affinity of a process?

Solution 1:

You can create a shortcut to assign affinity.

X:\Windows\System32\cmd.exe /C start /affinity Y game.exe

Y is hexadecimal and is a bit mask:

0x1 - 0001 - Core0
0x2 - 0010 - Core1
0x3 - 0011 - Core1 & Core0
0x4 - 0100 - Core2
0x5 - 0101 - Core2 & Core0
0x6 - 0110 - Core2 & Core1
0x7 - 0111 - Core2 & Core1 & Core0
0x8 - 1000 - Core3
0x9 - 1001 - Core3 & Core0
0xA - 1010 - Core3 & Core1
0xB - 1011 - Core3 & Core1 & Core0
0xC - 1100 - Core3 & Core2
0xD - 1101 - Core3 & Core2 & Core0
0xE - 1110 - Core3 & Core2 & Core1
0xF - 1111 - Core3 & Core2 & Core1 & Core0

Solution 2:

If by "non software" you mean not requiring additional software, there is. You can run the program from a command script and use the affinity switch "Start /AFFINITY 20 process.exe"

/AFFINITY 20treats the 20 as a hexidecimal number, with a binary equivalent of 100000, which sets affinity to core 5 out of 0-5 on a 6 core processor. A similar hex mask will let you disable a specific core, such as E, which only runs the process on cores 1-3 out of 0-3 or 0-5.