So when we click the "Run as administrator" in any program it doesn't ask for a password? so what user is performing operations there?
Here is what I'm trying to do - I'm trying to edit /etc/hosts
and currently I'm logged in as a administrator, I tried this in terminal
runas /user:MACHINE_NAME\username notepad <path_to_etc_hosts>
It opens, shows me the content of drivers/etc/hosts
files but when I try to save it I get an alert saying that I dont have permission to save this file ?
Now when I DIR /q
inside /divers/etc/hosts
I find that its owned by AUTHORITY\SYSTEM
not by the user my_logged_in_user
so now I have two questions, the might sound very silly (sorry) -
- How do I edit the file
- How "run as an administrator" (GUI actually works? which user is being used to open the file.