Windows – always run programs as administrator in Windows 10

processuacuser-accountswindows 10windows 7

The title is a bit misleading, but I cannot think of a better one. See the following example to explain what I want:

  • Under Windows 7, the current User I am using is a "Computer Administrator" account. After updating to Windows 10, the account type of my current User is still "Administrator".
  • Let's say I want to edit the C:\Windows\System32\drivers\etc\hosts file.
  • Typically I just use the Windows Explorer, navigate to that path and then right click on the hosts file and choose, in my case Edit with Sublime Text 2 – since I have Sublime Text 2 installed and I prefer to use that for editing any text file.
  • This works fine under Windows XP and Windows 7 (with UAC disabled). However, after updating to Windows 10 (also with UAC disabled), the Sublime Text process will not have enough rights to save that file.

So my question is: what is the difference here between Windows 7 and Windows 10? Why is a process, that is not run under the Administrator account under Windows 7 able to write to that location, but under Windows 10 it is not? Even though the account used in both cases is of type "Administrator?"

Best Answer

As @PetSerAl pointed out, setting UAC to Never Notify only enables the "administrator in Admin Approval Mode" user type while disabling all other User Account Control (UAC) policies.

To disable UAC completely, the EnableLUA property of

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

in the registry needs to be changed to 0. This disables the "administrator in Admin Approval Mode" user type, thus allowing all administrator users to run their processes as administrators by default.

See also https://msdn.microsoft.com/en-us/library/cc232765.aspx

Related Question