New
#1
Starting Application With Affinity
Greetings
Windows 10 1909
I would like to start an application setting its affinity and priority.
I currently have several applications setup to run from a batch file with high priority. The batch file to run with high priority is as follows:
start "" "F:\My Music\Program Files\Programs\folder\foo.exe"
TIMEOUT 5
wmic process where name="foo.exe" CALL setpriority 128
exit
That works for most applications. Where it doesn't, I run the program with the /high argument and delete the wmic line in the batch file. NOTE: obviously, I have changed the application name and its immediate containing folder :)
Anyway, I have looked on several sights to learn how to set the affinity of the application on startup, from a batch file. Nothing seems to work. I am sure I am doing something wrong. I created a batch file to run the program using the first 2 cores. Based on what I read regarding affinity, I setup the batch file this way:start "" /affinity 0x2 "F:\My Music\Program Files\Programs\program\foo.exe"TIMEOUT 5
wmic process where name="foo.exe" CALL setpriority 128
exit
When I run this, the program opens. I check task manager: right click the process, go to details, right click then click on priority and it is set to high as expected. Then I click on set affinity. All cores are checked (not what I want). What I typed in the batch file did not deactivate any cores.
Could anyone show me how to setup a batch file that would set the affinity and the priority? If you can, please do it with a program like notepad.exe and any filename, so that I could see it work.
Thanks for reading this. Thanks for your help.
Graham