No need for 3rd party apps.
Command line will do it.
Open cmd prompt
type START /? and it enter
the switch of interest is /AFFINITY
A simple text batch file should be all you need to start an app at the desired affinity.
Right, but if the app is already running then you're back to kill, then start etc..
If the batch is to be run only on the user's system then I see no problem with 3rd party software. However, if it's a homework assignment.... :)
That 3rd party app might indeed be better for the OP's situation since the app is already running. There might be a way to do it with start switches, but it is probably not worth the effort to figure out.
On XP, I used an add-on to task manager called
PRIO. It was not very stable, once I found a version that worked I stuck with it. But you could set both Affinity and Priority levels for most any process and it would remember them for you. The next time that the app started, the process would use the settings that you last had the PRIO app remember.
But that was not the main reason why I used PRIO, it added a services tab to task manager and a TCP/IP tab that was like netstat outputs.
Okay got it!
~~~
It works, only if I don't have any additional "f" process running. Which I usually don't.
Thanks.
You can send more than one key to the Task Manager window to select a process. Keys sent in rapid susession are interpreted as refinements of the item to be selected, not other processes to locate. e.g. one can send "CL" to locate CLOCK.exe. The "L" should not take the selection down to processes that start with "L".
I would suggest that you try sending the complete name of the process to the Task Manager window. That works for me using AutoIt, it should work for you using AHK. (AHK is a fork of AutoIt.) I've used both AHK and AutoIt. I prefer the AutoIt app and script editor, but I don't like the AutoIt forum :-(
Also, most anything that you can do with mouse clicks can be done with sending keystrokes. Keystrokes are usually easier to replicate than mouse click locations.
For example:
Shift+F10 is the same as right-click in most cases.
You can use the arrow up or arrow down to select items from the context menu - or better yet, send keystrokes.
If you really want to dive into this - then you would call the native Windows Application Programming Interface (API) and set the Affinity that way... but that is beyond my skill level in AutoIt. You might find a post in AutoIt's forum where someone has already written a script to do just what you are doing - only they did it without interacting with any windows - via the API.