Starting Application With Affinity


  1. gfd
    Posts : 74
    Windows 10 Pro 2004 (19041.264)
       #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
      My Computer


  2. Posts : 5,379
    Windows 11 Pro 64-bit
       #2
      My Computer


  3. gfd
    Posts : 74
    Windows 10 Pro 2004 (19041.264)
    Thread Starter
       #3

    Thanks Free Booter. I did some further research. The affinity mask in the web page you referenced worked for notepad and outlook. However, it didn't work for the program I am trying to open with a mask (FL Studio). I have posted on the Image-Line forum since it seems to be application specific and not an issue with the script.

    Thanks again.
      My Computer


  4. Posts : 5,379
    Windows 11 Pro 64-bit
       #4

    You are very welcome!
      My Computer


  5. Posts : 69,524
    64-bit Windows 11 Pro for Workstations
       #5

    Hello @gfd,

    If you haven't already, you might see if using the method in the tutorial below may help to run the program with the affinity you want.

    CPU Affinity Shortcut for a Program - Create in Windows | Windows 8 Help Forums
      My Computers


  6. gfd
    Posts : 74
    Windows 10 Pro 2004 (19041.264)
    Thread Starter
       #6

    Hey Brink,

    Thanks for the reply. I followed the tutorial. Fl Studio opened once again with all cores checked when I looked at affinity in Task Manager. I would give process lassoo a try but I don't want anything running on the system that isn't necessary.

    Are there processes that don't respond to a script starting it on fewer than all cores? Oddly enough, FL opens in high priority. I should point out that I have posted on the image-line forum, but have not gotten any response. That is not criticism. It is just that quite often starting a thread on two different forums is frowned upon.
      My Computer


  7. Posts : 191
    10, server 2016, server2012
       #7

    Brink said:
    Hello @gfd,
    If you haven't already, you might see if using the method in the tutorial below may help to run the program with the affinity you want.
    CPU Affinity Shortcut for a Program - Create in Windows | Windows 8 Help Forums
    hey Brink sorry to revive an old thread. the guide is very good but what if there are two processors in a machine, how would we be able to have that added to short cut?

    heres a screenshot, group 0 and 1 for 1st and 2nd CPU, how could this work with shortcut?

    Starting Application With Affinity-group0-1.jpg
      My Computer


  8. Posts : 69,524
    64-bit Windows 11 Pro for Workstations
       #8

    m18xr2 said:
    hey Brink sorry to revive an old thread. the guide is very good but what if there are two processors in a machine, how would we be able to have that added to short cut?

    heres a screenshot, group 0 and 1 for 1st and 2nd CPU, how could this work with shortcut?
    I'm not sure with two physical CPUs.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:05.
Find Us




Windows 10 Forums