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 "Set Priority" menu from the task manager.
My attempts at finding this on Google have been thwarted by those who can't come up with better adjectives.
Description. The nice command lets you run a command at a priority lower than the command's normal priority. The Command parameter is the name of any executable file on the system. If you do not specify an Increment value the nice command defaults to an increment of 10.
The where command is a Windows which equivalent in a command-line prompt (CMD). In a Windows PowerShell the alternative for the which command is the Get-Command utility.
The nice value determines the priority of the process. The higher the value, the lower the priority--the "nicer" the process is to other processes. The default nice value is 0 on Linux workstations. The SZ field displays the size of the process in memory.
If you want to set priority when launching a process you could use the built-in START command:
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/WAIT] [/B] [command/program] [parameters]
Use the low through belownormal options to set priority of the launched command/program. Seems like the most straightforward solution. No downloads or script writing. The other solutions probably work on already running procs though.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With