A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Performance and Maintainance of XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Limit CPU usage



 
 
Thread Tools Display Modes
  #1  
Old December 17th 09, 08:10 AM posted to microsoft.public.windowsxp.perform_maintain
Poppe
external usenet poster
 
Posts: 50
Default Limit CPU usage

Hello

Is there a way i can run a process, and limit it's CPU usage with some
in-built windows command? Or maybe run it with low priority?

Can you recommend some external program that enables me to do this?

I have a problem with a certain process running over the roof, causing CPU
problems.

Thanks!

Ads
  #2  
Old December 17th 09, 10:10 AM posted to microsoft.public.windowsxp.perform_maintain
Poppe
external usenet poster
 
Posts: 50
Default Limit CPU usage

Or is there a way i can change the priority of a running process from the
command line?

Thanks!

  #3  
Old December 17th 09, 10:10 AM posted to microsoft.public.windowsxp.perform_maintain
Poppe
external usenet poster
 
Posts: 50
Default Limit CPU usage

Or is there a way i can change the priority of a running process from the
command line?

Thanks!

  #4  
Old December 17th 09, 12:38 PM posted to microsoft.public.windowsxp.perform_maintain
John John - MVP[_2_]
external usenet poster
 
Posts: 1,637
Default Limit CPU usage

You can use the START command. For more information do START /? at a
command prompt.

John

Poppe wrote:
Hello

Is there a way i can run a process, and limit it's CPU usage with some
in-built windows command? Or maybe run it with low priority?

Can you recommend some external program that enables me to do this?

I have a problem with a certain process running over the roof, causing CPU
problems.

Thanks!

  #5  
Old December 17th 09, 12:38 PM posted to microsoft.public.windowsxp.perform_maintain
John John - MVP[_2_]
external usenet poster
 
Posts: 1,637
Default Limit CPU usage

You can use the START command. For more information do START /? at a
command prompt.

John

Poppe wrote:
Hello

Is there a way i can run a process, and limit it's CPU usage with some
in-built windows command? Or maybe run it with low priority?

Can you recommend some external program that enables me to do this?

I have a problem with a certain process running over the roof, causing CPU
problems.

Thanks!

  #6  
Old December 17th 09, 02:23 PM posted to microsoft.public.windowsxp.perform_maintain
Questor[_2_]
external usenet poster
 
Posts: 80
Default Limit CPU usage

---
Or is there a way i can change the priority of a running process from the
command line?

Thanks!


Once the process starts, you could use the Task Manager. Right click on
the task and choose "Set Priority" and select a priority from the slide-out.

Questor
  #7  
Old December 17th 09, 02:23 PM posted to microsoft.public.windowsxp.perform_maintain
Questor[_2_]
external usenet poster
 
Posts: 80
Default Limit CPU usage

---
Or is there a way i can change the priority of a running process from the
command line?

Thanks!


Once the process starts, you could use the Task Manager. Right click on
the task and choose "Set Priority" and select a priority from the slide-out.

Questor
  #8  
Old December 18th 09, 06:51 AM posted to microsoft.public.windowsxp.perform_maintain
Poppe
external usenet poster
 
Posts: 50
Default Limit CPU usage

Hello and thanks for suggestions

Does anybody know how to do this from the command line?

The situation is that the users are very basic, and they don't know how to
use task manager. So i should somehow automate the process priority setting,
so they don't have to do it manually.

Maybe use vbscript or something?

  #9  
Old December 18th 09, 06:51 AM posted to microsoft.public.windowsxp.perform_maintain
Poppe
external usenet poster
 
Posts: 50
Default Limit CPU usage

Hello and thanks for suggestions

Does anybody know how to do this from the command line?

The situation is that the users are very basic, and they don't know how to
use task manager. So i should somehow automate the process priority setting,
so they don't have to do it manually.

Maybe use vbscript or something?

  #10  
Old December 18th 09, 12:55 PM posted to microsoft.public.windowsxp.perform_maintain
John John - MVP[_2_]
external usenet poster
 
Posts: 1,637
Default Limit CPU usage

Poppe wrote:
Hello and thanks for suggestions

Does anybody know how to do this from the command line?

The situation is that the users are very basic, and they don't know how to
use task manager. So i should somehow automate the process priority setting,
so they don't have to do it manually.

Maybe use vbscript or something?


You can do it with WMI.

At the command prompt you use WMIC:

wmic process where name="notepad.exe" call setpriority 16384


In a script use the Win32_Process class and the SetPriority method:

-------------------------------------------------------------

Const BELOW_NORMAL = 16384
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcesses
objProcess.SetPriority(BELOW_NORMAL)
Next

----------------------------------------------------------------


Possible Priority class values a

64 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 Below Normal

Indicates a process that has priority above IDLE_PRIORITY_CLASS, but
below NORMAL_PRIORITY_CLASS. For Windows 2000.

32 Normal

Specified for a process with no special scheduling needs.

32768 Above Normal

Indicates a process that has priority above NORMAL_PRIORITY_CLASS, but
below HIGH_PRIORITY_CLASS. For Windows 2000.

128 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 of the available CPU time.

256 Real Time

Specified for a process that has the highest possible priority. The
threads of the process preempt the threads of all of the 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.


http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx
WMI Tasks: Processes (Windows)

http://msdn.microsoft.com/en-us/libr...87(VS.85).aspx
SetPriority Method of the Win32_Process Class (Windows)

John
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 07:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.