I read something similar to what you said in the past, Lars. Unfortunately, I am somewhat limited by what I can do with the machine in question (in other words, I cannot create user groups perforce: this is a server, and not just some random PC).
Thanks for the answers, Will and Lars. Unfortunately, they did not solve my problem.
The ultimate solution for this is to use WMI:
using System.Management;
String queryString = "select CreationDate from Win32_Process where ProcessId='" + ProcessId + "'";
SelectQuery query = new SelectQuery(queryString);
ManagementScope scope = new System.Management.ManagementScope(@"\\.\root\CIMV2");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection processes = searcher.Get();
DateTime startTime = ManagementDateTimeConverter.ToDateTime(processes[0]["CreationDate"].ToString());
TimeSpan uptime = DateTime.Now.Subtract(startTime);
Parts of this have been cleared from the code project:
http://www.codeproject.com/KB/system/win32processusingwmi.aspx
", !":
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jul05/hey0720.mspx