在powershell中,我可以使用
$app_name = "app.exe"
$app_arguments = "arg0"
Start-Process $app_name $app_arguments
我尝试设置与
$app = Start-Process $app_name $app_arguments
$app.ProcessorAffinity = 0x3
....没有工作。
在Windows Powershell中,当我启动一个进程时如何设置亲和力?
最佳答案
我可以解决
$app_name = "app.exe"
$app_arguments = "arg0"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $app_name
$pinfo.Arguments = $app_arguments
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start()
$p.ProcessorAffinity=0x3
关于windows - 在PowerShell中,在启动过程中设置亲和力,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19250927/