It works when I try. I double checked two test programs:
using System; using System.Diagnostics; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Process.Start("ConsoleApplication2.exe"); } } }
using System; using System.IO; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { try { File.WriteAllText(@"c:\program files\test.txt", "hello world"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); Console.ReadLine(); } } } }
First confirmed that I get a UAC bomb:
System.UnauthorizedAccessException: Access to path c: \ program files \ test.txt ".
// etc..
Then a manifest is added to ConsoleApplication1 with the phrase:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
There is no bomb. And a file that I cannot easily delete :) This is consistent with several previous tests on different machines with Vista and Win7. A running program inherits a security token from the startup program. If the starter has acquired administrator privileges, the running program also has them.
Hans Passant Mar 28 '10 at 13:33 2010-03-28 13:33
source share