I'm not an expert on the subject, but I do have experience with UAC, Vista + and VS2010. I spent several months reading up on the topic. On Vista+, your user account can be made or set to administrator, or the group administrator, just like on Windows XP, in which the setting claims you can make any changes to the system you desire, if your are using the Windows Desktop. But the Windows Desktop runs in 3 modes, mode 1 is a virtual mode, or a clone of the real windows desktop, mode 2, when you elevate, is the real administrators desktop, and mode 3 is the highest level of windows desktop. When you ran your code, it said of course you are an administrator, but you have to elevate past the clone desktop, by bringing up the elevate permission dialog in order to actually run code that requires administrative permissions in the real desktop. If you don't elevate, your code will not run, and return an error code 740. When you set UAC in the manifest to a higher level than AsInvoked, when the program starts, it will invoke the elevate dialog, and elevate the program to the next desktop level. I suspect your code is old school for Windows XP, and just sort of gives you the actual answer, which is true when running as AsInvoked. Writing for Vista and Windows 7 is a totally different way of thinking, UAC first, everything else second. You have to get permission from the desktop to make changes to the OS, or keep your programs boundaries in an isolated environment.