SETPRIO V1.0 for Windows NT, set the priority class of an already running process --------------------------------------------------------------------------------- (C) 1998 by Alexander Frink (Alexander Frink) Windows NT knows four basic priority classes for its processes, which are in decreasing priority order: - realtime - high - normal - low (also called idle) (don't confuse the realtime priority class with real realtime offered by a realtime operating system). You can choose one of these priority classes if you start a process from the command line with the START command (START [/LOW | /NORMAL | /HIGH | /REALTIME]), or if you create a process from within another program with the CreateProcess() API. Further, you can reschedule a running process into a different priority class with the task manager (right-click on the process). But there is no way to set a different priority from the command line, which would be necessary to automatically boost or slow down processes started by a program where you do not have the source code to (did you notice: this program comes with source code!). A good example is NTVDM, the NT Virtual DOS Machine, which runs 16 bit DOS and Windows programs. Many people have complained that NTVDM takes up 100% CPU resources, which makes task switching very slow (even on fast machines with lots of memory). By setting the priority class of NTVDM to low, the system will run much smoother. To accomplish this, modify the shortcut which start your Command Prompt from '%SystemRoot%\system32\cmd.exe /c' to '%SystemRoot%\system32\cmd.exe /k INSERT_PATH_TO_SETPRIO\setprio ntvdm 0 -q'. For more information on how to use this program, type SETPRIO on the command line, which should give you everything you need. Please note: SETPRIO will set the priority for all running instances of a process, unless use give it the PID. WARNING: Changing the priority class of a process may cause undesired results including system instability. Do not set important processes to a priority too low, and unimportant ones to high or realtime. A simple while (1) {} running as realtime will use all system resources! If you have any problems or suggestions, contact the author via e-mail at Alexander.Frink@Uni-Mainz.DE Files included (unpack with an unzip that is aware of long filenames): - setprio.exe Binary for Intel x86 - a_setprio.exe Binary for DEC Alpha - readme.txt this file - src\setprio.c the main file - src\tasklist.c a library which cycles through all open processes (based on the TLIST example from Microsoft) - src\tasklist.h header file for tasklist.c - src\privs.c set/clear privileges (based on Microsoft code from knowledge base article Q131065) - src\privs.h header file for privs.c - src\setprio.mak makefile for x86 (replace all occurences of I386 with ALPHA to build SETPRIO on DEC Alpha)