I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well.
The proper way to do this is to call SetProcessPriorityClass with PROCESS_BACKGROUND_MODE_BEGIN to initiate a background mode. This causes a Very Low (background) I/O priority and Idle CPU priority. When done, call SetProcessPriorityClass again, supplying PROCESS_BACKGROUND_MODE_END. The same can be done at the thread level via SetThreadPriority and THREAD_BACKGROUND_MODE_BEGIN/END.
If you want to directly set the I/O priority, independently of the CPU priority, you must use the NT native APIs. I documented it here, but did not include code examples as we all know they get ripped verbatim.
The API you want is the NT Native API NtSetInformationProcess. Using this API you can change the I/O priority. This API accepts a 'class' variable telling it what type of information about the process you want to change, that class variable must be set to ProcessIoPriority. You can then set the entire process's I/O priority in this manner.
Similarly, the I/O priority can be retrieved via NtQueryInformationProcess.
The bad news is that the priority levels are a bit limited. Critical is reserved for system paging operations. That leaves you with Normal and Very Low (Background). Low and High may or may not be implemented in newer editions of Windows. There seems to be partial support, at the very least.
If you have no experience with the NT Native APIs, the first thing to do is understand them. Once you do, you'll see it is as simple as a single API call.