Admin mode changes
-
Hello and first of all: thanks for othe software. I am using notepad++ longer than I can remember now :-)
I recently updated notepad++ and ran into the following situation. since i am not sure if itās supposed to be like this or just some new windows shenanigans, I am happy about any kind of hint or explanation.
The general situation
- opening np++ as normal user
- opening a file that is readable by user, but onyl writable by admin
The behaviour before the update:
When i change the file and click āsaveā, a dialog appeared that told me np++ has to restart in admin mode. when doing this, everything worked as expected, i save the edit and restart np++ as normal user againThe behaviour after the update:
np++ just saves the file!
I do not know how that is possible or what exactly is going on (not a win sec expert).
I can happily supply more information and would gladly get the old behaviour back.Thanks in advance!
-
@Xan-Kun ,
Yes, Notepad++ drastically improved the behavior when trying to save admin-only files in v8.8.6 in October.
Specifically, in older versions (v8.8.5 and earlier), when it would make you restart Notepad++, there are two conditions:
- If you had left the option to save the session snapshot with periodic ābackupā enabled, then your changes would be preserved in the periodic ābackupā, and when it restarted as Admin (after Windows OS does a UAC prompt, unless you have UAC prompting off), then it would be able to save them. And then youād accidentally leave it running as Admin, and could accidentally ovewrite any file you wanted, and might mess up your settings. So, a great situation to be in.
- But if you had disabled the periodic backup, like many do (see our backup FAQ for reasons why), then when Notepad++ asked if you wanted to restart, you would have to
Ctrl+A Ctrl+Cto copy all the changes before asking the question itās currently prompting you for, then then restart Notepad++ (*: and not prompt you about unsaved changes; so if you didnāt do the copy-all already, you just lost minutes or hours of changes; wheee!!!), then see that the file is back to the original (because it couldnāt be saved), and then have to paste in your changes (hoping you hadnāt accidentally hitCtrl+Con anything in the meantime, losing your file changes), and then do the save. And then you would need to remember to exit Notepad++ and manually restart it (because Notepad++ doesnāt have a ārestart in normal modeā button or menu entry when youāre running as Admin) to go back to normal editing.
And, in v8.8.6 and newer: You would edit a file. When you go to hit save, Notepad++ asks Windows OS for permission to write to the protected file. If you have UAC enabled, then Windows OS will do the UAC prompt to let you know itās writing to a protected file, and then do it; if you have UAC disabled, then Windows checks if your user is allowed to elevate without asking, and if it does, it automatically elevates and allows Notepad++ to save. But either way, after that save, Notepad++ is back to the normal permissions, and there is no chance you will forget to switch out of Admin mode and/or get your config files messed up. So much better situation.
Re-enabling the Windows OS UAC prompts (that you disabled at some point) would get you the level of ādonāt accidentally save this Admin fileā protection you want, without ruining the improvement for everyone who runs without periodic backup or doesnāt want to risk corrupting their config files and doesnāt want to ruin dragging a file from Windows Explorer into Notepad++ because Notepad++ was accidentally left in Admin mode. (Itās also best practice for Windows security. If you are running with your main user who can be elevated without Windows doing a UAC prompt, then as soon as any malware gets on your system, even if itās only running as your ānormalā user, it can access every file on your drive by just telling Windows ābut Iām user Xan-Kun, so of course Iāll play niceā. So you are opening yourself to a huge security risk by running without Windows UAC prompts.)
The change was intentional. The change makes the software better. As a fellow user of Notepad++, I donāt see a good reason to go back to pre-8.8.6 behavior.
-
@PeterJones Thank you so much for the detailed explanation! š¤
I understand now why it behaves differently than before and can totally relate.
Keep up the great work! šbtw, i am simply using the superbly integrated āRead-Onlyā functionaility! So I get the the safety AND convenience (no restart required).
All the best.