[windows] 用 command line 設定執行檔的優先權

  • 4097
  • 0

[windows] 用 command line 設定執行檔的優先權

經理從大陸急 call,問了一個從來沒有想過的問題:

如何用命令列來指定程式的執行優先權

馬上上網 google,方法如下:

 

(1)在啟動時指定,使用

---

start /<priority> <wanted.exe>。

---

priority 有以下選擇:

[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]

詳細指令可用 start /? 來查詢

 

(2)執行之後再改變,使用 wmic。

參考網頁:http://superuser.com/questions/620724/changing-windows-process-priority-via-command-line

wmic 是一個多功能的工具,在這裡的使用範例是:

---

wmic process where name="notepad.exe" CALL setpriority "real time"

wmic process where name="notepad.exe" CALL setpriority 256

---

可選用的 priority 有:

idle: 64

below normal: 16384

normal: 32

above normal: 32768

high priority: 128

real time: 256

 

自己寫下來免得忘記。

 

 

 

分享