- Local time
- 4:18 AM
- Posts
- 152
- OS
- Windows 11 27783
Theres an affinity tweak for a setting in my script that if the user has less than 4 cpu cores, the setting shouldnt be used. Using wmic, the cpu is queried for core count and then checks to see if enough cores are present to execute the command. Does this code look good (@garlin)?
for /f "tokens=*" %%f in ('wmic cpu get NumberOfCores /value ^| find "="') do set %%f
if !NumberOfCores! gtr 4 (
for /f %%i in ('wmic path Win32_VideoController get PNPDeviceID^| findstr /l "PCI\VEN_"') do (
reg add "HKLM\SYSTEM\CurrentControlSet\Enum\%%i\Device Parameters\Interrupt Management\Affinity Policy" /v "DevicePolicy" /t REG_DWORD /d "3" /f
)
Last edited:
My Computer
System One
-
- OS
- Windows 11 27783
- Computer type
- PC/Desktop
- CPU
- Intel i7 7700 @4.0ghz
- Memory
- 64gb DDR4
- Graphics Card(s)
- Radeon RX 5500 XT
- Other Info
- https://www.github.com/shoober420