When editing source code files in program files folder, Notepad++ has a handy feature that reopens it in administrator mode (if you have admin rights). Thus it allows saving those files.

But since Notepad++ is now in Administrator mode. It is very restrictive; it does not allow remote editing and other features that normal mode do.

Is there a way to revert back to Normal mode with a click of a button/menu? (I can restart Notepad++, but that seems tedious).

  • AFAIK there isn't a plugin for it. It can be easily done using the AutoHotKey(1). Without it, it can be done by pressing two keyboard shortcuts in sequence(2). Please let me know whether you are interested in option 1 or 2. – miroxlav Sep 15 '17 at 20:08
  • @miroxlav what is the second option - two keyboard shortcuts? – Cricrazy Sep 15 '17 at 20:21
  • Are you referring to the nppSaveAsAdmin plugin? – DavidPostill Sep 15 '17 at 20:47
  • It is possible to set up the environment that one keyboard shortcut reliably exits N++ and second one starts it. Are you interested? (Easier than this, I can imagine only the AutoHotKey doing the same in single step.) – miroxlav Sep 30 '17 at 7:34
  • @miroxlav sure. – Cricrazy Oct 5 '17 at 13:49

You can achieve this by using two keyboard shortcuts in sequence.

Preparation (only once):

  1. set Notepad++ to exit without prompt. So from now on, Alt+F4 will immediately exit Notepad++ (keeping everything saved).

  2. Pin Notepad++ into fixed position on the taskbar so its icon is there even if it is not running. For example, let's say you used 4th position so you can activate the icon by pressing Win+4.

Quick manual restart:

  • Press Alt+F4 and Win+4.

Quick restart where AutoHotKey sends the above keys for you when you press Ctrl+Alt+R (or whatever else you choose):

; only if Notepad++ window is active
#IfWinActive Notepad++
   Send !{F4}
   Sleep 1000
   Send #4

You can adjust Sleep 1000 (milliseconds) to other value which works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.