Jump to content

Start .exe with a set Affinity

Go to solution Solved by Nineballo,

This will have to be edited for your use case, but figured if anyone stumbles on this in the future they should get the answer...

 

 

@echo off

cd C:\Users\NineB\Documents                   

"Tom Clancy's Rainbow Six Siege.url"

echo R6 Started

ping 127.0.0.1 -n 101 > nul                                                   

Echo Changing Priority to 1-4

PowerShell "$Process = Get-Process RainbowSix; $Process.ProcessorAffinity=30

Echo Done

Pause

Explanation Below

Spoiler

#ANYTHING HIGHLIGHTED MIGHT NEED TO BE CHANGED FOR YOUR USE CASE

#ALSO DELETE ALL COMMENTS BEFORE USE  

 

@echo off 

cd C:\Users\NineB\Documents     #Changes Directory              

 

"Tom Clancy's Rainbow Six Siege.url" #Starts Shortcut placed in said directory

 

echo R6 Started

 

ping 127.0.0.1 -n 101 > nul         #Wait 100 sec for program to start up (kind of a misused... but it works)   

                                  

Echo Changing Priority to 1-4 

 

PowerShell "$Process = Get-Process RainbowSix; $Process.ProcessorAffinity=30 #Changes the process affinity to use cores 1-4 leaving 0 and 5 for the system

 

Echo Done

 

Pause #you can change this to exit if you want cmd to close

 

How would one create a (.bat) shortcut to a steam game (R6) to run it only on cores 1-4, leaving 0 and 5 for the system and other tasks?

 

To my knowledge this cant be done with the /Affinity command (unless i did it wrong) due to the fact that steam spawn's the process and the process takes steams affinity and priority settings. 

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to comment
https://linustechtips.com/topic/1052069-start-exe-with-a-set-affinity/
Share on other sites

Link to post
Share on other sites

From Dos, with "copy con" command.

google it.

CPU:i7 9700k 5047.5Mhz All Cores Mobo: MSI MPG Z390 Gaming Edge AC, RAM:Corsair Vengeance LPX 16GB 3200MHz DDR4 OC 3467Mhz GPU:MSI RTX 2070 ARMOR 8GB OC Storage:Samsung SSD 970 EVO NVMe M.2 250GB, 2x SSD ADATA PRO SP900 256GB, HDD WD CB 2TB, HDD GREEN 2TB PSU: Seasonic focus plus 750w Gold Display(s): 1st: LG 27UK650-W, 4K, IPS, HDR10, 10bit(8bit + A-FRC). 2nd: Samsung 24" LED Monitor (SE390), Cooling:Fazn CPU Cooler Aero 120T Push/pull Corsair ML PRO Fans Keyboard: Corsair K95 Platinum RGB mx Rapidfire Mouse:Razer Naga Chroma  Headset: Razer Kraken 7.1 Chroma Sound: Logitech X-540 5.1 Surround Sound Speaker Case: Modded Case Inverted, 5 intake 120mm, one exhaust 120mm.

Link to post
Share on other sites

"Copy con is an MS-DOS and Windows command line command that allows the creation of a file through the command line. To use this command, type copy con followed by the name of the file you want to create, as shown below."

 

To my knowledge this just creates/duplicates's a file, how would you change affinity's with it?

 

 

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to post
Share on other sites

This will have to be edited for your use case, but figured if anyone stumbles on this in the future they should get the answer...

 

 

@echo off

cd C:\Users\NineB\Documents                   

"Tom Clancy's Rainbow Six Siege.url"

echo R6 Started

ping 127.0.0.1 -n 101 > nul                                                   

Echo Changing Priority to 1-4

PowerShell "$Process = Get-Process RainbowSix; $Process.ProcessorAffinity=30

Echo Done

Pause

Explanation Below

Spoiler

#ANYTHING HIGHLIGHTED MIGHT NEED TO BE CHANGED FOR YOUR USE CASE

#ALSO DELETE ALL COMMENTS BEFORE USE  

 

@echo off 

cd C:\Users\NineB\Documents     #Changes Directory              

 

"Tom Clancy's Rainbow Six Siege.url" #Starts Shortcut placed in said directory

 

echo R6 Started

 

ping 127.0.0.1 -n 101 > nul         #Wait 100 sec for program to start up (kind of a misused... but it works)   

                                  

Echo Changing Priority to 1-4 

 

PowerShell "$Process = Get-Process RainbowSix; $Process.ProcessorAffinity=30 #Changes the process affinity to use cores 1-4 leaving 0 and 5 for the system

 

Echo Done

 

Pause #you can change this to exit if you want cmd to close

 

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×