Windows Equivalent of 'nice'

后端 未结 4 1806
轻奢々
轻奢々 2020-12-01 08:40

Is there a Windows equivalent of the Unix command, nice?

I\'m specifically looking for something I can use at the command line, and not the

4条回答
  •  感动是毒
    2020-12-01 09:28

    If you use PowerShell, you could write a script that let you change the priority of a process. I found the following PowerShell function on the Monad blog:

    function set-ProcessPriority { 
        param($processName = $(throw "Enter process name"), $priority = "Normal")
    
        get-process -processname $processname | foreach { $_.PriorityClass = $priority }
        write-host "`"$($processName)`"'s priority is set to `"$($priority)`""
    }
    

    From the PowerShell prompt, you would do something line:

    set-ProcessPriority SomeProcessName "High"
    

提交回复
热议问题