Como cambiar prioridad de proceso que esta ejecutandose, desde linea de comandos?

11/02/2005 - 03:02 por Marcelo V | Informe spam
Hola,
Alguien sabe como cambiar la prioridad desde linea de comandos de un
proceso que ya esta ejecutandose?

Salu2!
Ing. Marcelo V.
 

Leer las respuestas

#1 Marcelo V
11/02/2005 - 04:29 | Informe spam
Ya lo he encontrado.
Luego de 1 hora de buscar en google y no encontrar nada.
Entre en la pagina de microsoft :-)

y encontre este script en VBScript:

Const ABOVE_NORMAL = 16384

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "oot\cimv2")

Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Notepad.exe'")

For Each objProcess in colProcesses
objProcess.SetPriority(ABOVE_NORMAL)
Next

Priority
[in] New priority class for the process. Value Meaning
64
0x40 Idle
Specified for a process with threads that run only when the system
is idle. The threads of the process are preempted by the threads of a
process that run in a higher priority class, for example, a screen saver.
The idle-priority class is inherited by child processes.

16384
0x4000 Below Normal
Indicates a process that has priority above IDLE_PRIORITY_CLASS but
below NORMAL_PRIORITY_CLASS. For Windows 2000.

32
0x20 Normal
Specified for a process with no special scheduling needs.

32768
0x8000 Above Normal
Indicates a process that has priority above NORMAL_PRIORITY_CLASS
but below HIGH_PRIORITY_CLASS. For Windows 2000.

128
0x80 High Priority
Specified for a process that performs time-critical tasks that must
be executed immediately. The threads of the process preempt the threads of
normal or idle priority class processes. An example is the Task List, which
must respond quickly when called by the user, regardless of the load on the
operating system. Use extreme care when using the high-priority class,
because a high-priority class application can use nearly all available CPU
time.

256
0x100 Realtime
Specified for a process that has the highest possible priority. The
threads of the process preempt the threads of all other processes, including
operating system processes that perform important tasks. For example, a
real-time process that executes for more than a very brief interval can
cause disk caches not to flush or a mouse to be unresponsive.


Return Values
Returns one of the values in the following table, or a different value to
indicate an error.

Return Code Description
0 Successful completion
2 Access denied
3 Insufficient privilege
8 Unknown failure
9 Path not found
21 Invalid parameter


Salu2!
Ing. Marcelo V.

"Marcelo V" escribió en el mensaje
news:
Hola,
Alguien sabe como cambiar la prioridad desde linea de comandos de
un proceso que ya esta ejecutandose?

Salu2!
Ing. Marcelo V.

Preguntas similares