How-To Geek

Start an Application Assigned to a Specific CPU in Windows 7, 8, or Vista

Windows has an option that lets you start an application and set the CPU affinity, which assigns the application to run on a specific CPU in a dual-core system.

To start an application you have to pass the affinity flag to the start utility in the command prompt. For instance, if you wanted to start notepad assigned to CPU, you could use the following command:

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

You can see in task manager that the process is only assigned to CPU 0

To start a process on CPU 0, use the following command switch:

/affinity 1

For CPU 1, use this switch:

/affinity 2

You can use a number up to the number of CPU cores or CPUs in your system. The affinity is essentially CPU core # + 1, so /affinity 5 would use CPU 4.

You can almost modify the shortcut for an item to make it run on the specific CPU, by just prepending the full “c:\windows\system32\cmd.exe /C start /affinity 1 ” onto the shortcut target. The only drawback to this approach is that the command prompt window will briefly flash on the screen.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 02/8/07

Comments (32)

  1. John McCutchen

    /affinity 5 does not use CPU 4

    1 uses CPU0
    2 uses CPU1
    3 uses CPU0 and CPU1
    4 uses CPU2
    5 uses CPU2 and CPU0
    6 uses CPU2 and CPU1
    7 uses CPU2, CPU1, and CPU0
    8 uses CPU3
    9 uses CPU3 and CPU0

    Convert the number to hex and reverse it to see which CPUs are to be used.

    I’m really appreciative of what you have shared with me as I have some applications that I’ve needed to be able to control the affinity of a process that I spawn.

    Thanks for your help.

  2. Dean

    Thanks to for this website. I’ve been work’n /w Vista going on two months and as your all aware. You have to unlearn what you’ve learned. Those older versions of window ie,. xp, xpro etc. have NOTHING on Vista. NO more just editing INI’s is a thing of the past. But Wait There IS MORE! Hope anyone\everyone who aquires a version of vista like to read for this is NOT for the LAZY…..


  3. Jason Grant

    Is there anyway to force this with XP without having to reset the CPU affinity each time you launch the app?

  4. Dan

    Jason, try

    Originally this comes from the Win2K resource toolkit, so probably safer to get it from there.

  5. Michael Vetter

    It seems that start /affinity works just for some applications. For example by starting firefox with start /affinity 01 firefox.exe the affinity was not set correctly. Could anybody else prove this or have a workaround?

  6. Mike Honeycutt

    I play with the affinity and priority in XP and feel it improves my performance. In particular, I have Folding and Ghost 12 running in the background most of the time and don’t even know they are there. I put everything that loads during the startup process on one core and lower the priority (with the exception of explorer.exe). This works well for me but I’d be curious if it works equally well for you.

    1. Download PROCESS.EXE from

    2. Create a batch file – this is part of my batch but it should get you started.

    set cpu=10
    set speed=Low

    process > x:\process.fil

    for /f “tokens=2 delims= ” %%v in (x:\process.fil) do process -a “%%v” %cpu%
    for /f “tokens=2 delims= ” %%v in (x:\process.fil) do process -p “%%v” %speed%

    process -a “explorer.exe” 01
    process -p “explorer.exe” Normal

    BTW, I use this on Vista and XP.

    Mike Honeycutt

  7. elvizzz

    sample C:\Windows\System32\cmd.exe /c start “runhigh” /high /AFFINITY 1 “C:\Program Files\Windows Media Player\wmplayer.exe” /prefetch:3 all work’s but how to assign like cpu 1 and 2 to a app greeting’s from the low land’s

  8. elvizzz

    anser if you have 4 core,s affinity as follows
    10=0,1,2,3 and again greeting from da low land’s

  9. elvizzz


    sample C:\Windows\System32\cmd.exe /c start “runhigh” /high /AFFINITY D “C:\Program Files\Windows Media Player\wmplayer.exe” /prefetch:3
    so “affinity D” results in the usage of core 0,2,3

  10. Ger

    OK I tried this on a game that seems to crash when using multicore but is supposed to be ok if affinity is set to 1 core. The problem is no matter if i do it thru command prompt or by using taskmanager it keeps resetting affinity to all cores. Any ideas or suggestions?

  11. Ger

    The game also has an option for multicore support but makes no difference if it is on or off

  12. alxtorrentazos

    c:\windows\system32\cmd.exe /C start /affinity 1 does not work in XP…… says AFFINITY is an invalid switch….any other way to do this in command prompt in XP?
    Thanks in advance.

  13. LazyBoot

    I cam manage to get this working from the commandline… but not from a shortcut….
    the target is currently C:\Windows\System32\cmd.exe /c start /affinity 1 “C:\Spill\A Vampyre Story\game\main.exe”
    but all I get is a commandline window with “C:\Spill\A Vampyre Story\game\main.exe” as the title…

  14. Daemon

    When you put it in quotes it names the window, try it like this:

    target: C:\Windows\System32\cmd.exe /c start /affinity 1 main.exe
    start in: “C:\Spill\A Vampyre Story\game\”

  15. Mr X
  16. Lazygamer

    When i try to do this in a shortcut with a quad core everything pops up and runs as it is supposed to but when i check taskmgr to see if the process is on all affinities, it is only on 2. What i have is:

    Target: “c:\windows\system32\cmd.exe /C start /affinity 10 Wow.exe”
    Start in: “C:\program files\world of warcraft\”

    How do i make it run on all 4 cores?

  17. LazyBoot

    lazygamer, it does that because wow only supports 2 cores, and won’t use more…
    (you can use the 2 other cores for multitasking or something though)

  18. Dale

    Nice information but I have apps that load on startup that really slow everything down until they’ve loaded (VK and anti-spyware). They both fight for supremacy over CPU 0 while CPU 1 is idle. This makes the startup take forever.

    I’d like to set the affinity before windows starts up instead of after. Seems like I need something like the app Mr X suggested that loads as a service on boot, then configure it to set the affinity of stuff that loads during startup.

    Unless someone else knows a way to force this without a bootable app.

  19. oHPaQue

    Good article! But keep in mind that this is HEX mask and is read from right to left:

    CPU3 CPU2 CPU1 CPU0 Bin Hex
    OFF OFF OFF ON = 0001 = 1
    OFF OFF ON OFF = 0010 = 2
    OFF OFF ON ON = 0011 = 3
    OFF ON OFF OFF = 0100 = 4
    OFF ON OFF ON = 0101 = 5 confirmed via task manager
    OFF ON ON OFF = 0110 = 6
    OFF ON ON ON = 0111 = 7
    ON OFF OFF OFF = 1000 = 8
    ON OFF OFF ON = 1001 = 9
    ON OFF ON OFF = 1010 = A confirmed via task manager
    ON OFF ON ON = 1011 = B
    ON ON OFF OFF = 1100 = C
    ON ON OFF ON = 1101 = D
    ON ON ON OFF = 1110 = E confirmed via task manager
    ON ON ON ON = 1111 = F

    Of course, the CPU on task mananager is listed left to right, so now you have to flip all of the above.

    HEX 30 = Binary 110000 = CPU5 CPU4, but I ONLY have a quad core, so I cannot confirm this works or not. :)

    Then create a .BAT file that contains this command to start the app on CPU1 and CPU3:
    START/AFFINITY A .\”some executable name.exe”

    Where .\ denotes the current directory, and if there are any spaces between the names, put the whole thing in “”.

    If you need to add /D and full path:
    START/AFFINITY A /D C:\”Program Files”\”some app folder” C:\”Program Files”\”some app folder”\”some app.exe”

    Notice that each folder names are encased in “” betwen the \’s. From my experience I found this following does not work:
    START/AFFINITY A /D “C:\Program Files\some app folder” “C:\Program Files\some app folder\some app.exe”

    You can create a shortcut to the batch file, and right click and select “Run As Administrator” as needed. It’s too bad the START command doesn’t offer this option…

    Now script/batch till you drop! :)

  20. Dale

    It would be nice to find out if we can set a parameter in the registry for this. Some programs run on boot and it can be helpful in some cases to have them on different processors.

    For example, when my system starts up, it loads AVG and Spybot which both take a lot of processing resources during startup resulting in a very slow start while they both wrestle for dominion over the processor time. Since they will both use processor 1 as a default, processor 2 remains idle. Being able to define the default processor for these applications at boot up would eliminate a lot of this contention and streamline the boot process.

    Unfortunately, these sort of programs cannot be executed from a batch process to load on startup… Or can they?

  21. Sam

    I tried using c:\windows\system32\cmd.exe /C start /affinity 1 “C:\Games\SimCity 4\Apps\Simcity 4.exe”, but it just opens a command prompt window with the name SimCity 4 and the exe’s folder displayed to the left, never actually opening the game.

  22. Dale


    Take out the space you put between START and /AFFINITY
    There should be no space there and it will also cure the invalid switch errors too for XP users.

    You can also have a batch file to do it. Create a text file in the game directory where simcity4.exe is and rename it to simcity4.bat.

    edit into the batch file the following line:

    Now use the batch file as a shortcut to run the program. I know this works since I use it to run Everquest when I run both my accounts on two monitors at once.

  23. Sam

    Thanks, but it still opens the DOS prompt. I tried c:\windows\system32\cmd.exe /C start/affinity 1 “C:\Games\Maxis\SimCity 4 Deluxe\Apps\Simcity 4.exe” The batch file produced the same result.

  24. buff

    I doubt any of you (the ones are having problems with the DOS prompt and the ones with the “invalid switch”) would be able to make it work, with the “space” or without it. The reason I suspect is because it only works on vista and up (windows 7 probably) but it doesnt under XP. A simple “start /?” from the command line would show you if it accepts that parameter. Good luck with it!!

  25. omegatotal

    this should work on ANY system that is newer than XP, and i dont see why you couldn’t copy the cmd.exe from a vista machine and use it (dont overwrite the xp cmd.exe, rename the new one to cmd2.exe or something before you copy it)

  26. Risuun

    I can’t get the affinity or priorities to work in Windows 7 unless I use the CD command to navigate to the directory of the .exe file.

    Like this works:

    CD “C:\Program Files (x86)\Adobe\Adobe Photoshop CS3\”
    start /high /affinity 55 program.exe

    But this doesn’t:

    start /D “C:\Program Files (x86)\Adobe\” /high /affinity 55 photoshop.exe

  27. Risuun

    *typo in the last comment*

    This works in win 7:

    CD “C:\Program Files (x86)\Adobe\Adobe Photoshop CS3\”
    start /high /affinity 55 program.exe

    But I can’t get it to work with one command/line like this:

    start /D “C:\Program Files (x86)\Adobe\Adobe Photoshop CS3\” /high /affinity 55 photoshop.exe

    And I can’t get it to run either when adding the info to links.

  28. lubos.o

    If want to run gtasa.exe (in C:/Program Files/Rockstar/gta.exe) on only one CPU, I write
    c:\windows\system32\cmd.exe /C start /affinity 1 gta.exe?
    c:\windows\system32\cmd.exe /C start /affinity 1 C:/Program Files/Rockstar/gta.exe ?

  29. emerald000

    Neither lubos.o,

    it should be: c:\windows\system32\cmd.exe /C start /affinity 1 “C:/Program Files/Rockstar/gta.exe”

    The lack of quotes make Windows look for C:/Program, which does not exist.

  30. Guy

    I used this for Battlefield Bad Company 2 or BFBC2. I opted to only run one one thread on each of the four true cores aka cores 1,3,5,7. Works great just replace the ( ) with your variables

    With variables not set
    Target: c:\windows\system32\cmd.exe /C start /affinity (hex#) (example.exe)
    Start in: “(path of exe)”

    With variables set
    Target: C:\Windows\System32\cmd.exe /C start /affinity AA BFBC2Game.exe
    Start in: “C:\Program Files (x86)\Electronic Arts\Battlefield Bad Company 2”

    Resource 1: coreinfo.exe
    Had a bit of a hassle getting it to run on win 7 64x, navigate to “c:\windows\system32\cmd.exe” and run as administrator. Type:
    CD (location)
    for me:
    CD C:\Users\UserName\Downloads\Coreinfo
    at the > prompt type:
    coreinfo.exe -c
    this will give you what you need to start choosing your processors in their binary format. Mine looks like this
    Logical to Physical Processor Map:
    **—— Physical Processor 0 (Hyperthreaded)
    –**—- Physical Processor 1 (Hyperthreaded)
    —-**– Physical Processor 2 (Hyperthreaded)
    ——** Physical Processor 3 (Hyperthreaded)
    Changing each of the * locations to either 0 or 1 will respectively turn the processor off or on.
    My Decimal code is 10101010 and converts to hex of AA but that’s next.
    Get it at:

    Resource 2:Converter
    This is EZ now that you can see the binary format of your cores just go to this site and enter your combination of 1’s and 0’s in the Binary box and get the hex # you need.
    So for dual cores(I havent seen a coreinfo dump so im assuming):
    01 or 10 or 11
    Dual Hyper-threaded or quad
    0001 or 0010 or 0100 or 1000 or 0011 or 0101 and so on
    Quad Hyperthreaded
    00000001 or 00000010 or 00000100 or 00001000 and so on and on

  31. Faraz Azhar

    I would like to add something to the wonderful things people have taught here.

    If you read the command line.. it has the word START in it. ‘Start’ is actually a command for windows to start any application/process. If you type ‘start /?’ at command prompt it will show its details.

    All the people who are having trouble starting their games with affinity, i.e. are seeing only a black window opening and nothing happening, have one thing in common: The filename of the game’s exe has space in it. e.g. “Simcity 4.exe”. It has space in it. So to type it properly, it has to be put inside quotation marks. Now the START command considers quotation marks as the title of the window. if you put anything inside quotes, it will open black window and name its caption as the words inside quotes.

    To solve this problem, you have to provide a title name and the file name both with quotes to the START command. Like this:

    Target: C:\Windows\System32\cmd.exe /c start “” /affinity 1 “SimCity 4.exe”
    Start In: “C:\Program Files\Maxis\SimCity 4 Deluxe\Apps”

    We have provided a blank title (“”) and put the app name in quotes because it has spaces. It resolves the problem.
    This solution will work for any application that has spaces in its exe’s file name.

  32. jerry giffin

    Hey!!..You guys are great!I can now play my games online while still downloading torrents at the same time with no fps reduction.And my fps on flight simulator rocketed up.Here is how I set my affinity:

    imagecfg -a 0x126 “C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\FSX.exe”
    imagecfg -a 0x128 “C:\Program Files (x86)\HiFi\ASA\ASA_Exec.exe”
    imagecfg -a 0x128 “C:\Program Files (x86)\Abacus\CoPilot Pro\CoPilot.exe”
    imagecfg -a 0x1 “C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe”
    imagecfg -a 0x128 “C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Flight One Software\Cockpit Chatter\CockpitChatter.exe”

    imagecfg -a 0x126 “C:\Hitech Creations\Aces High\aceshigh.exe”

    imagecfg -a 0x126 “C:\Program Files (x86)\Activision\Call of Duty – World at War\CoDWaW.exe”

    imagecfg -a 0x126 “C:\Program Files (x86)\Activision\Call of Duty – World at War\CoDWaWmp.exe”

    imagecfg -a 0x126 “C:\Program Files (x86)\Activision\Call of Duty 4 – Modern Warfare\iw3sp.exe”

    imagecfg -a 0x126 “C:\Program Files (x86)\Activision\Call of Duty 4 – Modern Warfare\iw3mp.exe”

    imagecfg -a 0x128 “C:\Program Files (x86)\BitTorrent\Bittorrent.exe”

    I am running intel i7, windows 7,have 8 cpu’s,6 gig mem,nvidia 9600 GSO card
    Do these look alright to you?

More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!