Query regarding UAC and editing files in Windows system folders

0

If I try to edit a text file in a system folder such as Program Files or Windows with Notepad (or an image with Paint, or... you get the idea) and then save it I get an "Access denied" error. Now I know why and I don't want to run Notepad elevated all the time. What I want to know is, why can't Notepad request elevation at this point instead of simply throwing an error and forcing one to save elsewhere? Is this an oversight by the Notepad developers (or they just didn't care to update it to be UAC friendly) or is there a technical reason for the lack of a UAC elevation dialog?

A_r

Posted 2014-04-07T02:44:08.913

Reputation: 1

Answers

0

Notepad will have no idea you want to do something with it that requires elevation until you try to do it and get an error message. At that point, it is reasonable to assume the user does not in fact have administrative standing, because otherwise the user would have asked Notepad to run elevated by right-clicking its icon/shortcut and choosing "Run as Administrator".

kreemoweet

Posted 2014-04-07T02:44:08.913

Reputation: 3 884

Why should the user have to run Notepad as admin, then navigate to and open the text file, when he can simply open the file directly? There are other processes that request elevation as and when required (which is the correct way of doing it as far as I know). So why can't Notepad automatically request elevation when the user opens a file from a system folder, or when it realizes that the user is trying to save to a system folder? – A_r – 2014-04-07T07:59:36.170