1

Similar to this question to the following question, I try to limit the cpu usage of an process: Are there solutions that can limit the CPU usage of a process?

But I want to limit the process as soon as it is started (every process with an given path). I did not find this feature in the tools that were in the answers of the referenced question?

I need this to reproduce an error of an software at startup, which (as my best guess is) coheres with the limited performance of the computer that it is started on. It starts up within a few seconds, so I need a tool which can limit the process quick.

deetz
  • 113
  • 1
  • 4

2 Answers2

1

I need this to reproduce an error of an software at startup

Since you only need to do this as a one-off for testing, and not long-term or permanently, the easiest way may be to use a virtual machine. Both VirtualBox and Hyper-V allow you to cap guest performance at a % of the host CPU. VMware Workstation does not, but VMware ESXi does let you specify a CPU frequency.

See also, https://www.virtualbox.org/manual/ch03.html, Limiting CPU speed in a virtual machine?

Bob
  • 60,938
  • 25
  • 191
  • 216
0

From here: https://www.eightforums.com/tutorials/40287-cpu-priority-shortcut-program-create-windows.html

The syntax is this:

cmd.exe /c start "Program Name" /priority "Full path to executable"

So, if you want to start Notepad with low CPU priority, you'd use the following command:

cmd.exe /c start "Notepad" /low "C:\Windows\notepad.exe"

Now, what you'll need to do in your specific case is replace the existing startup entry for the program in question with this command.

This should work for most programs that run when your computers runs, but some OS-specific applications may not be able to be so modified.

Telling us WHICH executable(s) you're looking at could help us get you a more thorough answer.

music2myear
  • 40,472
  • 44
  • 86
  • 127
  • 1
    This won't actually "limit the CPU usage" unless there are other things of higher priority that are trying to run at the same time. If there are enough other such things then it may cause the subject process to get almost _no_ CPU time. Low priority does not mean "limit to 25%" or anything like that. – Jamie Hanrahan Mar 01 '17 at 00:59
  • You're right. It is a relative scale. But at the same time, what is 25% usage of a CPU? Any solution will be relative or based on certain assumptions. This is a simple method that requires no additional software and which should work on most applications. – music2myear Mar 03 '17 at 16:38