您的最佳的信息源和新聞 硬件, 司機 并且 硬件 在互聯網

景色文章 名列前茅50 景色錄影 景色軟 景色幫助

自動地名義上設置過程的優先權,在景色


最近我戲耍與 圖像文件施行選擇 并且Sysinternals』 處理顯示器在景色。 我看一次有趣的詢問發生。 使用notepad.exe为例,我為稱「PerfOptions的」鑰匙看了詢問在[HKEY_LOCAL_MACHINE \軟件\微軟\視窗NT \ CurrentVersion \圖像文件施行選擇\ notepad.exe],當我跑了筆記薄。 結果是命名沒發現,因此我決定矯正那。 在增加名為「PerfOptions的」鑰匙以後,我再跑了筆記薄。 在處理顯示器,我為四價值看了詢問:

由於最近探險與處理priorities*, CpuPriorityClass立即劫掠了我。 看 SetPriorityClass 作用,你能為dwPriorityClass參量看不同的價值。 我在PerfOptions創造了REG_DWORD名為CpuPriorityClass,并且設置了價值對0×80希望筆記薄將發射與「HIGH_PRIORITY_CLASS」的。 反而,它發射了以優先權NORMAL_PRIORITY_CLASS (8) -設置未造成任何衝擊。 然後,我設置了價值到8并且發射了筆記薄。 筆記薄發射了以優先權8。 我改變了價值到4,并且那沒有衝擊。 我改變了價值到0 -沒有衝擊。 我嘗試了10 -沒有衝擊。 我不可能看任何領帶對我知道處理優先權的任何其他目錄,因此我決定從0開始嘗試嘗試,以以下結果:


CpuPriorityClass價值 筆記薄優先權 優先權類
1 4 懶惰
3 13
5 6 BelowNormal
6 10 AboveNormal
別的^ 8 正常

^=我當前跑a PowerShell 寫電影腳本通過所有可能的價值重複(仅有關於2^32…) 如此它也許是一會兒在CpuPriorityClass價值之前為REALTIME_PRIORITY_CLASS,如果它存在,被揭露。 也許也有可以用於指定優先權類被揭露的其他價值。 我將更新或張貼一個新的題目,如果我揭露新的任何東西…

PowerShell劇本(不要笑,它是我的第一堅固企圖一致) :

$cpc=0set-itemproperty 「hklm :softwaremicrosoftwindows ntcurrentversionimage文件施行optionsnotepad.exeperfoptions」 cpupriorityclass $cpcdo {    $pp = [diagnostics.process] : :開始(」 notepad.exe」, 「」)    $ppc = $pp.PriorityClass    $pp. 殺害()    如果($ppc - ne 「法線」)    {        寫主人$cpc $ppc    }    $cpc++    設置itemproperty 「hklm :softwaremicrosoftwindows ntcurrentversionimage文件施行optionsnotepad.exeperfoptions」 cpupriorityclass $cpc},當時($cpc - lt 4294967295)

有希望地,在PerfOptions - IoPriority、PagePriority和WorkingSetLimitInKB將發現時刻做一些開掘入其他價值的我。 IoPriority和PagePriority聲音,如他們也許與有關 記憶prioritization 并且 IO prioritization 在景色。 WorkingSetLimitInKB sounds self-explanatory, but how it’s applied or how it’s used, and other circumstances, are quite vague.

*= SetThreadPriority, Vista, and Autostart Locations, Setting the Priority of a Service Process via Script

Popularity: 4%


Written by «/\/\Ø|ö±ò\/»®©. Read more great feeds at is source WEBSITE
1 comment.
Read more articles on otherSoftware and Process Monitor and priority and sysinternals and PowerShell and vista.

Related articles

1 comment

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com Henry Widmore
#1. January 31st, 2008, at 8:40 AM.

does this work for other os like XP or server 2003?

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .