문제

Unix 명령과 동일한 Windows 명령이 있습니까? 멋진?

저는 특히 명령줄에서 사용할 수 있는 것을 찾고 있습니다. ~ 아니다 작업 관리자의 "우선순위 설정" 메뉴.

Google에서 이것을 찾으려는 나의 시도는 더 나은 형용사를 생각해 낼 수 없는 사람들에 의해 좌절되었습니다.

도움이 되었습니까?

해결책

프로세스를 시작할 때 우선순위를 설정하려면 내장된 시작 명령을 사용할 수 있습니다.

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/B] [command/program] [parameters]

실행된 명령/프로그램의 우선순위를 설정하려면 낮음부터 정상보다 낮은 옵션을 사용하십시오.가장 간단한 해결책처럼 보입니다.다운로드나 스크립트 작성이 필요하지 않습니다.다른 솔루션은 아마도 이미 실행 중인 프로세스에서 작동할 것입니다.

다른 팁

당신이 사용하는 경우 파워셸, 프로세스의 우선순위를 변경할 수 있는 스크립트를 작성할 수 있습니다.다음 PowerShell 함수를 찾았습니다. 모나드 블로그:

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)`""
}

PowerShell 프롬프트에서 다음 명령을 수행합니다.

set-ProcessPriority SomeProcessName "High"

어쩌면 당신은 사용을 고려하고 싶을 수도 있습니다 프로세스 테이머 설정에 따라 프로세스 우선순위를 다운그레이드하거나 업그레이드하는 프로세스를 "자동화"합니다.

나는 그것을 2년 동안 사용해 왔습니다.매우 간단하지만 정말 효과적입니다!

~에서 http://techtasks.com/code/viewbookcode/567

# This code sets the priority of a process

# ---------------------------------------------------------------
# Adapted from VBScript code contained in the book:
#      "Windows Server Cookbook" by Robbie Allen
# ISBN: 0-596-00633-0
# ---------------------------------------------------------------

use Win32::OLE;
$Win32::OLE::Warn = 3;

use constant NORMAL => 32;
use constant IDLE => 64;
use constant HIGH_PRIORITY => 128;
use constant REALTIME => 256;
use constant BELOW_NORMAL => 16384;
use constant ABOVE_NORMAL => 32768;

# ------ SCRIPT CONFIGURATION ------
$strComputer = '.';
$intPID = 2880; # set this to the PID of the target process
$intPriority = ABOVE_NORMAL; # Set this to one of the constants above
# ------ END CONFIGURATION ---------

print "Process PID: $intPID\n";

$objWMIProcess = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\cimv2:Win32_Process.Handle=\'' . $intPID . '\'');

print 'Process name: ' . $objWMIProcess->Name, "\n";

$intRC = $objWMIProcess->SetPriority($intPriority);

if ($intRC == 0) {
    print "Successfully set priority.\n";
}
else {
    print 'Could not set priority. Error code: ' . $intRC, "\n";
}

PrcView는 명령줄에서도 작동하는 것 같습니다.

http://www.teamcti.com/pview/prcview.htm

(-ph 매개변수를 확인하세요)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top