Changing into Admin mode removes all changes

  • If I edit a file in e.g. Program files, then when it comes to save it I get an error:

    Save failed

    The file cannot be saved and it may be protected.
    Do you want to launch Notepad++ in Administrator mode?

    Answering Yes, will set Notepad++ to Administrator mode AND restore the document to the state it had before I changed it!!!

    So I have to start over and make the changes again :-(

    Is this a bug, working as designed or do I have have to configure something?

    // Anders

    Notepad++ v7.7.1 (32-bit)
    Build time : Jun 16 2019 - 21:14:50
    Path : C:\Program Files (x86)\Notepad++\notepad++.exe
    Admin mode : OFF (before I try to save, it is set to ON after I have answered yes to the question…)
    Local Conf mode : OFF
    OS : Windows 10 (64-bit)
    Plugins : ComparePlugin.dll DSpellCheck.dll JSMinNPP.dll mimeTools.dll NppConverter.dll NppExport.dll NppTextFX.dll XMLTools.dll

  • but after admin mode npp open in new instance window did you notice that

  • @Anders-Eriksson22

    There is a plugin named NppSaveAsAdmin which has been developed especially for your use case. It is available via PluginsAdmin.

    Instead of launching a new instance of Notepad++ in admin mode (which causes the data loss you described) it starts code from a companion DLL file in admin mode which saves your document to the desired location.

  • Thanks for the tip of NppSaveAsAdmin . It was not available from the PluginsAdmin, but I downloaded it from SourceForge

    Works perfectly!!

    One problem less…

    // Anders

Log in to reply