Is there a way to configure a Windows service process (e.g. squidNT, SQL Server, etc) to start automatically with low priority without manually changing process priority via Task Manager?
feedback
|
|
The Service Control Manager, which handles starting / stopping services, doesn't have any mechanism (in any version of Windows heretofore) to specify the priority on processes it starts. Since you can modify the priority on an already-running process, your best bet might be to use a tool to do that. I'm not aware of a Microsoft command-line tool to modify process priority, but the "PV" command-line too, available at http://www.teamcti.com/pview/prcview.htm has a function to set priority.
That would set "process-name.exe" to "Below Normal" priority. If you can live with the process starting out at "Normal" priority until you get around to changing it, you could do so with a script running as a "Scheduled Task" to fire off every-so-often (in case the service gets bounced). It's a quick and dirty hack, but I owe a lot of my fortune in life to quick and dirty hacks that get the job done! | |||
feedback
|
|
The following might also work. Edit the ImagePath registry key, and use the start command from cmd.exe: START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/WAIT] [/B] [command/program] [parameters] | |||
|
feedback
|
|
start /low or cmd.exe start /low will not work because the service needs to receive a message from the system that the service was started succefully, and start or cmd will not send this "ok". | |||
|
feedback
|