2015-03-30 112 views
0

我想在遠程計算機上啓動進程(我知道遠程計算機的管理憑證)。用於遠程機器上開始一個應用程序,我使用「調用命令」或「輸入的PSSession」,這將啓動遠程機器上處理在遠程計算機上執行應用程序

Start-Process -FilePath 'C:\pqr.exe' -ArgumentList '/a' -Verb runas -WindowStyle Normal 

命令。現在問題是,我能夠開始處理,但很快處理CPU分配的飢餓(它變爲0%),並且突然啓動的應用程序不再重新編碼。有沒有其他的方式來分配它的CPU或運行管理員權限以上的commandlet。

回答

0

你應該開始處理,然後改變進程的優先級 的命令行語法:

wmic process where name="AppName" CALL setpriority ProcessIDLevel 

例子:

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

wmic process where name="notepad.exe" CALL setpriority "above normal" 

優先級:

空閒:64

低於正常:16384

正常:32

高於正常:32768

高優先級:128

實時:256

或使用powershell [System.Diagnostics.ProcessPriorityClass] 指定 「正常,空閒,高,實時,BelowNormal,AboveNormal」 例如

$a = (Get-Process -Name powershell) 
$a.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::RealTime 
+0

無法在對象 – 2015-04-01 04:24:03

+0

@ kaustubh93上找到屬性「Priorityclass」proirtyclass正在使用.net 4.5的powersehll v4工作,導致get-process'請參見[link](https:// t echnet.microsoft.com/en-us/library/hh849832.aspx)...但wmi查詢應該爲你工作 – powershell 2015-04-01 15:41:59

0

你有沒有試過這種下列枚舉值之一:

PsExec

或許這對你的工作

相關問題