Processor Affinity - Add Set Affinity to Context Menu How to Add or Remove "Run with CPU Affinity" to the Context Menu  Information By default, Windows 7 and Vista runs an application on all available cores of the processor. If you have a multi-core processor, then this will show you how to add or remove Run with CPU Affinity from all application files and shortcuts context menu to set processor affinity to an application to control which core(s) of the processor an application will run on.
If the application and CPU supports Symmetric Multiprocessing (SMP) or HyperThreading (HT), then Windows will automatically adjust the application's usage of each processor core for the best performance. You will not gain much, if anything, from manually changing the processor affinity for these type od applications.  Note The affinity changes you make to the current instance of an application or process are only temporary and not set permanently.
Once you close the application or restart your system, Windows forgets your set affinity and automatically sets back the default affinity of the application running on all available cores of the processor.  Warning I have included REG downloads below to add context menu items for up to a 12 core processor. How many cores you actually have will depend on your processor. You can add one or more of any of the following Run with CPU Affinity context menu items below to use as needed. DO NOT ADD A CONTEXT MENU ITEM numbered above how many cores you actually have.
You can quickly see how many processor cores you have by opening Task Manager (CTRL+SHIFT+ESC), clicking on the Performance tab, and counting how many CPU Usage History graphs you have. EXAMPLE: Run with CPU Affinity Added or Removed from Context Menu   OPTION ONE Using a REG File Download NOTE: You can only merge these REG files while logged in as an administrator. See warning box above. CPU-0 = Processor Core 1, CPU-1 = Processor Core 2, etc.......1. To Add Run with CPU-0 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-0_Affinity_to_Context_Menu.reg 
2. To Remove Run with CPU-0 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-0_Affinity_from_Context_Menu.reg 
3. To Add Run with CPU-1 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-1_Affinity_to_Context_Menu.reg 
4. To Remove Run with CPU-1 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-1_Affinity_from_Context_Menu.reg 
5. To Add Run with CPU-2 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-2_Affinity_to_Context_Menu.reg 
6. To Remove Run with CPU-2 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-2_Affinity_from_Context_Menu.reg 
7. To Add Run with CPU-3 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-3_Affinity_to_Context_Menu.reg 
8. To Remove Run with CPU-3 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-3_Affinity_from_Context_Menu.reg 
9. To Add Run with CPU-4 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-4_Affinity_to_Context_Menu.reg 
10. To Remove Run with CPU-4 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-4_Affinity_from_Context_Menu.reg 
11. To Add Run with CPU-5 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-5_Affinity_to_Context_Menu.reg 
12. To Remove Run with CPU-5 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-5_Affinity_from_Context_Menu.reg 
13. To Add Run with CPU-6 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-6_Affinity_to_Context_Menu.reg 
14. To Remove Run with CPU-6 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-6_Affinity_from_Context_Menu.reg 
15. To Add Run with CPU-7 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-7_Affinity_to_Context_Menu.reg 
16. To Remove Run with CPU-7 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-7_Affinity_from_Context_Menu.reg 
17. To Add Run with CPU-8 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-8_Affinity_to_Context_Menu.reg 
18. To Remove Run with CPU-8 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-8_Affinity_from_Context_Menu.reg 
19. To Add Run with CPU-9 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-9_Affinity_to_Context_Menu.reg 
20. To Remove Run with CPU-9 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-9_Affinity_from_Context_Menu.reg 
21. To Add Run with CPU-10 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-10_Affinity_to_Context_Menu.reg 
22. To Remove Run with CPU-10 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-0_Affinity_from_Context_Menu.reg 
23. To Add Run with CPU-11 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-11_Affinity_to_Context_Menu.reg 
24. To Remove Run with CPU-11 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-11_Affinity_from_Context_Menu.reg 
25. Click on Save, and save the .reg file to the desktop. 26. Right click the downloaded .reg file on the Desktop and click on Merge. 27. Click on Run, Yes, Yes, and OK when prompted. 28. When done, you can delete the downloaded .reg file(s) on the desktop if you like. OPTION TWO Using a BAT File Download NOTE: You can only merge these BAT files while logged in as an administrator. See warning box above. Special thanks to Dwarf for this option. CPU-0 = Processor Core 1, CPU-1 = Processor Core 2, etc.......1. To Add Run with CPU-0 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-0_Affinity_to_Context_Menu.bat 
2. To Remove Run with CPU-0 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-0_Affinity_from_Context_Menu.bat 
3. To Add Run with CPU-1 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-1_Affinity_to_Context_Menu.bat 
4. To Remove Run with CPU-1 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-1_Affinity_from_Context_Menu.bat 
5. To Add Run with CPU-2 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-2_Affinity_to_Context_Menu.bat 
6. To Remove Run with CPU-2 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-2_Affinity_from_Context_Menu.bat 
7. To Add Run with CPU-3 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-3_Affinity_to_Context_Menu.bat 
8. To Remove Run with CPU-3 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-3_Affinity_from_Context_Menu.bat 
9. To Add Run with CPU-4 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-4_Affinity_to_Context_Menu.bat 
10. To Remove Run with CPU-4 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-4_Affinity_from_Context_Menu.bat 
11. To Add Run with CPU-5 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-5_Affinity_to_Context_Menu.bat 
12. To Remove Run with CPU-5 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-5_Affinity_from_Context_Menu.bat 
13. To Add Run with CPU-6 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-6_Affinity_to_Context_Menu.bat 
14. To Remove Run with CPU-6 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-6_Affinity_from_Context_Menu.bat 
15. To Add Run with CPU-7 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-7_Affinity_to_Context_Menu.bat 
16. To Remove Run with CPU-7 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-7_Affinity_from_Context_Menu.bat 
17. To Add Run with CPU-8 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-8_Affinity_to_Context_Menu.bat 
18. To Remove Run with CPU-8 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-8_Affinity_from_Context_Menu.bat 
19. To Add Run with CPU-9 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-9_Affinity_to_Context_Menu.bat 
20. To Remove Run with CPU-9 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-9_Affinity_from_Context_Menu.bat 
21. To Add Run with CPU-10 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-10_Affinity_to_Context_Menu.bat 
22. To Remove Run with CPU-10 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-0_Affinity_from_Context_Menu.bat 
23. To Add Run with CPU-11 Affinity to Context MenuA) Click on the Download button below to download the file below. Add_Run_with_CPU-11_Affinity_to_Context_Menu.bat 
24. To Remove Run with CPU-11 Affinity from Context MenuA) Click on the Download button below to download the
file below. Remove_Run_with_CPU-11_Affinity_from_Context_Menu.bat 
25. Click on Save, and save the .bat file to the desktop. 26. Right click the downloaded .bat file on the Desktop and click on Run as administrator. 27. Click on Run and Yes when prompted. 28. When done, you can delete the downloaded .bat file(s) on the desktop if you like.
That's it,
Shawn |  Published by | | Administrator Join Date: Oct 2008 Location: Texas Posts: 37,303 | |
 Tutorial Tools | | | | | |