0

Is it possible to change the core affinity of a already running process on the commandline?

Example:

@echo off
start "" "C:\Program Files\Internet Explorer\iexplore.exe"
:TASKLIST
tasklist /FI "IMAGENAME eq iexplore.exe" | find /i "iexplore.exe"      

IF ERRORLEVEL 2 GOTO LOOP2
IF ERRORLEVEL 1 GOTO LOOP1 

:LOOP1 
  Change Core affinity to all cores
goto EXIT     

:LOOP1 
  timeout 5 >nul
goto TASKLIST

:EXIT

I know how to start a programm with the core affinity set, but I would like to know how I could do that with a running process?

Andreas
  • 5,393
  • 9
  • 44
  • 53
  • 2
    There is a [related question here](https://stackoverflow.com/questions/19187241/change-affinity-of-process-with-windows-script), do you require to do that without PowerShell ? – Zilog80 May 06 '21 at 08:00
  • Hello, thanks for the infos. It would be perfect if we could do it without PowerShell. – Paul Stein May 06 '21 at 08:09
  • Call **start /?**. Read about parameter **/AFFINITY**. – Daemon-5 May 07 '21 at 07:22

0 Answers0