小编ada*_*itj的帖子

Windows + Powershell:如何更改所有 java.exe 实例的处理器关联性?

基于StackOverflow 上的这个问题,如果可执行文件仅在 1 个实例中运行,我可以使用以下命令更改处理器关联性:

PowerShell "$Process = Get-Process java; $Process.ProcessorAffinity=11"
Run Code Online (Sandbox Code Playgroud)

如果有 2 个或更多实例正在运行,我无法更改,这是输出

C:\PowerShell "$Process = Get-Process java; $Process.ProcessorAffinity=11"
The property 'ProcessorAffinity' cannot be found on this object. Verify that the property exists and can be set.
At line:1 char:30
+ $Process = Get-Process java; $Process.ProcessorAffinity=11
+                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException
Run Code Online (Sandbox Code Playgroud)

有谁知道如何使用 Powershell 更改所有 java.exe 实例的处理器关联性?

windows cpu powershell windows-server-2012

0
推荐指数
1
解决办法
7092
查看次数

标签 统计

cpu ×1

powershell ×1

windows ×1

windows-server-2012 ×1