How to start executable with realtime priority?

Viewed 8632

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?

3 Answers

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.

@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.

Related