#167113 - 2006-09-08 09:57 PM
Re: OT: howto set process' priority low for good?
|
Gargoyle
MM club member
   
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
|
|
Top
|
|
|
|
#167115 - 2006-09-08 11:42 PM
Re: OT: howto set process' priority low for good?
|
Gargoyle
MM club member
   
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
But it sounded like it would fix your issue? You never said it had to be free And if there is program to do it, Jooel can find a KiX way to do it.
|
|
Top
|
|
|
|
#167116 - 2006-09-09 12:01 AM
Re: OT: howto set process' priority low for good?
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
so, this looks nicer... http://www.wiredprairie.us/journal/2005/12/set_process_priority_utility.html
just wonder, why doesn't windows provide a way to control the basePriority via a regvalue or so. or in other words, why that function is not documented.
|
|
Top
|
|
|
|
#167117 - 2006-09-09 01:08 AM
Re: OT: howto set process' priority low for good?
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4567
Loc: USA
|
|
|
Top
|
|
|
|
#167121 - 2006-09-09 04:26 PM
Re: OT: howto set process' priority low for good?
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
did a simple udf for it, but... can't set the priority of kixtart process. get access denied error. and not from com object itself...
Code:
function SetPriority($prio, optional $pid, $iName) dim $wmi,$list,$process
$wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
if len($iName) $list = $wmi.ExecQuery("Select * from Win32_Process Where Name = '"+$iName+"'") else $list = $wmi.ExecQuery("Select * from Win32_Process Where ProcessID = '" + $pid + "'") endif For Each $process in $list $setPriority = $process.SetPriority($prio) Next exit @error endfunction
"setting the prio of this process to low." ? setPriority(16384,@pid) ? get $
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 675 anonymous users online.
|
|
|