6

So I try this on windows 8.1:

start /low cmd

And I get cmd process with low priority. But when I do:

start /realtime cmd

I get new cmd process with high priority.

Is there a way to get realtime without setting it manually? Also, can I somehow set desired priority from the code of my application, maybe WinApi or something?

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
Kriattiffer
  • 617
  • 2
  • 8
  • 20

3 Answers3

7

It works when you are executing start as an administrator.

Technically, you need the SeIncreaseBasePriorityPrivilege, which an administrator normally has. If you don't, it looks like albeit I couldn't find any documentation about that fact, that you are silently reverted to a priority that is still viable with the calling account.

I doubt that Win32 will help, as the same restrictions surely apply.

Christian.K
  • 47,778
  • 10
  • 99
  • 143
3

To make realtime work from CMD or Process Lasso without admin rights, it needs to be changed in:

secpol.msc > Local Policies > User Rights Assignment > Increase Scheduling Priority > Properties > Add user or group > Write down "Everyone" > check name > OK

I needed the solution to launch VBS script running CMD with priority set command in background, I couldn't open VBS script as admin.

kiyah
  • 1,502
  • 2
  • 18
  • 27
1
@ECHO OFF
ECHO Setting process priority    
wmic process where name="process.exe" CALL setpriority "Realtime"

A solution is to start the process as you are, but then run the above batch script file as administrator.

IT-Dan
  • 565
  • 5
  • 15