I run an Audio Repeater application which allows me to play sound through my headset & Speakers at the same time. The Application itself has an ability to set itself to "RealTime" but it only sets it to high so at the moment I have to set it myself in Task Manager.

I decided to automate this so I wrote a little script in C# that would change the process priority for me (That I would add to start up once I've finished)

namespace ProcessRealtime
{
    class Program
    {
        static void Main(string[] args)
        {
            Process[] processes = Process.GetProcessesByName("audiorepeater");
            foreach (Process proc in processes)
            {
                Console.WriteLine("Changing Priority for: "+proc.Id+" To RealTime");
                proc.PriorityClass = ProcessPriorityClass.RealTime;
                if (proc.PriorityClass == ProcessPriorityClass.RealTime)
                {
                    Console.WriteLine("Worked");
                }
            }
            Console.ReadLine();
        }
    }
}

The problem is that it does not apply the changes. Screenshot of Desktop

Does anyone know why this will not work?

Edit
Report