![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Launching processes with low priority? Is it possible in PS to influence the priority of a launched process (like start /low in DOS)? Thorsten |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Launching processes with low priority? If you have already launched application then you can change PriorityClass property for process: $a = gps powershell $a.PriorityClass = "BelowNormal" or with looping: gps iexplore | %{$_.PriorityClass = "High"} All acceptables values are here: [vPodans] [Enum]::getNames("Diagnostics.ProcessPriorityClass") Normal Idle High RealTime BelowNormal AboveNormal If you want to start a new process with custom priority, you can use Win32_Process WMI class with ProcessPriority property (which represents Win32_ProcessStartup class). http://msdn.microsoft.com/en-us/libr...88(VS.85).aspx - Create Method of the Win32_Process Class http://msdn.microsoft.com/en-us/libr...75(VS.85).aspx - Win32_ProcessStartup Class -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Thorsten Albrecht" <route-to-nowhere@xxxxxx> rakstija zinojuma "news:h06ju4t7sl94pupp2pb9bhg6nn3ah17etl@xxxxxx"... Quote: > Is it possible in PS to influence the priority of a launched process > (like start /low in DOS)? > > Thorsten |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Launching processes with low priority? Hi Thorsten, I just know how to change the proiority of a running process. The simple version is ... ([wmi]'Win32_Process=172').SetPriority(16384) at which 172 is the process id and 16384 is the new priority (see below). To change multiple processes by a key value (e.g. process name) you can run this ... Get-WmiObject Win32_process -filter 'name = "notepad.exe"' | foreach-object { $_.SetPriority(32) } At last the list of priority codes ... 256 REALTIME 128 HIGH_PRIORITY 32768 ABOVE_NORMAL 32 NORMAL 16384 BELOW_NORMAL 64 IDLE Good luck and regards from munich, Uwe Thorsten Albrecht wrote: Quote: > Is it possible in PS to influence the priority of a launched process > (like start /low in DOS)? > > Thorsten |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Launching processes with low priority? And for completeness sake, you can also directly use System.Diagnostics.Process. There's minor drilldown necessary, working with the System.Diagnostics.ProcessStartInfo subitem, but it does provide the ability to completely control every aspect of the started process. http://msdn.microsoft.com/en-us/libr...s.process.aspx http://msdn.microsoft.com/en-us/libr...startinfo.aspx "Vadims Podans [MVP]" <vpodans> wrote in message news:Ocs9nhAwJHA.3676@xxxxxx Quote: > If you want to start a new process with custom priority, you can use > Win32_Process WMI class with ProcessPriority property (which represents > Win32_ProcessStartup class). > http://msdn.microsoft.com/en-us/libr...88(VS.85).aspx - Create > Method of the Win32_Process Class > http://msdn.microsoft.com/en-us/libr...75(VS.85).aspx - > Win32_ProcessStartup Class > -- > WBR, Vadims Podans > MVP: PowerShell > PowerShell blog - www.sysadmins.lv > > "Thorsten Albrecht" <route-to-nowhere@xxxxxx> rakstija zinojuma > "news:h06ju4t7sl94pupp2pb9bhg6nn3ah17etl@xxxxxx"... Quote: >> Is it possible in PS to influence the priority of a launched process >> (like start /low in DOS)? >> >> Thorsten |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Launching processes with low priority? Uwe Kausch <UweKausch.News@xxxxxx> wrote: Quote: >To change multiple processes by a key value (e.g. process name) you can run this ... > Get-WmiObject Win32_process -filter 'name = "notepad.exe"' | foreach-object { $_.SetPriority(32) } thanks. Another possibility would be to start the powershell shell itself with lower priority. Thus all child processes have the same low priority. Thorsten |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Launching processes with low priority? On Apr 18, 2:09*am, Thorsten Albrecht <route-to- nowh...@xxxxxx> wrote: Quote: > Is it possible in PS to influence the priority of a launched process > (like start /low in DOS)? > > Thorsten $proc = [System.Diagnostics.Process]::Start("notepad.exe") $proc.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::BelowNormal |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| CPU Priority for Processes | Tutorials | |||
| launching/not launching programs upon logging in | Vista General | |||
| Priority question | Vista General | |||
| USB Priority | Vista General | |||
| Codec Priority | Vista music pictures video | |||