Community
    • Login

    Stuck in "Administrator" mode...how to get out?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    35 Posts 10 Posters 16.5k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alan KilbornA Offline
      Alan Kilborn
      last edited by

      Thanks for everyone’s efforts so far…

      1 Reply Last reply Reply Quote 2
      • Meta ChuhM Offline
        Meta Chuh moderator
        last edited by

        @Alan-Kilborn said:

        Thanks for everyone’s efforts so far…

        you can’t imagine how hard it was for me to keep my finger off that upvote button right now 😂😂😂 ;-)

        1 Reply Last reply Reply Quote 5
        • Ilkka LindblomI Offline
          Ilkka Lindblom
          last edited by

          Re-enabling UAC fixed this issue for me. Unfortunately, probably due to all the uninstalls and reinstalls I made while trying to fix it, NPP seems to have lost my saved session. Still I’m glad to have it working again, so thanks a lot people.

          Meta ChuhM 1 Reply Last reply Reply Quote 3
          • Meta ChuhM Offline
            Meta Chuh moderator @Ilkka Lindblom
            last edited by Meta Chuh

            side note to @Alan-Kilborn, as this thread was resurfaced by @Ilkka-Lindblom :

            i guess my evil upvote finger’s incubation period for “Thanks for everyone’s efforts so far…” is over.
            my hooked, crooked finger just went haywire on that damned button … and i sincerely hope you won’t notice it at all 😉

            1 Reply Last reply Reply Quote 3
            • Alan KilbornA Offline
              Alan Kilborn
              last edited by Alan Kilborn

              So an update to this thread…

              I’m still in Notepad++ 7.5.x land for my day-to-day Notepad++ usage, but recently I had reason to grab a portable 7.6.4…and I noted that running this one it DOES NOT end up in Administrator mode. By this I mean no [Administrator] in the title bar, and able to drag-n-drop files from a non-admin Explorer window.

              So just a little nicety waiting for me when I get around to making the Plugin Mgr -> Plugin Admin chasm jump! :)

              I don’t know what changed in N++ so that this now happens, but I’m going to mark this thread SOLVED if I can.

              Meta ChuhM 1 Reply Last reply Reply Quote 2
              • Meta ChuhM Offline
                Meta Chuh moderator @Alan Kilborn
                last edited by

                hi @Alan-Kilborn

                aaahhhhh … the upvote thread, lol
                i love revisiting things like these 💚
                i’ve got a big smile on my face right now 😃

                ps:
                very intriguing … if 7.6.4 and above don’t trigger administrator mode, but 7.6.3 and below do, could it be that it gets triggered by the existence of a code signing cert on the older versions on your system ?

                i have never heard about a behaviour like this if something is code signed, but 7.6.4 was the first release without windows code signing. ⁉️

                Alan KilbornA 1 Reply Last reply Reply Quote 2
                • Alan KilbornA Offline
                  Alan Kilborn @Meta Chuh
                  last edited by

                  @Meta-Chuh

                  I did not do exhaustive testing, but I just went back and tried 7.6.3 and 7.6.2 portable versions. Both of these showed [Administrator] in the title bar. Trying 7.6.4 again…still no [Administrator] there! :)

                  1 Reply Last reply Reply Quote 3
                  • anselme16A Offline
                    anselme16
                    last edited by

                    good lord the source code determining if the application should launch in administrator is ugly.

                    here is a clarified version of it :

                    Notepad_plus::Notepad_plus()
                    :   _isAdministrator (false)
                    {
                        // Determine if user is administrator.
                        winVer ver = NppParameters::getInstance()->getWinVersion();
                        if (ver >= WV_VISTA || ver == WV_UNKNOWN)
                        {
                            SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
                            PSID AdministratorsGroup;
                            if(AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup))
                            {
                                BOOL isAdmin;
                                if(CheckTokenMembership(NULL, AdministratorsGroup, &isAdmin))
                                    _isAdministrator = isAdmin;
                                FreeSid(AdministratorsGroup);
                            }
                        }
                    }
                    

                    Sorry i couldn’t resist.

                    1 Reply Last reply Reply Quote 0
                    • Alan KilbornA Offline
                      Alan Kilborn
                      last edited by

                      @anselme16 said:

                      here is a clarified version

                      I’m confused – why is it ugly? Looking at the existing code (below) I’m struggling to see any significant ugliness or even any real differences between it and your version:

                      Notepad_plus::Notepad_plus()
                          /* ... */
                      {
                          /* ... */
                          
                          // Determine if user is administrator.
                          BOOL is_admin;
                          winVer ver = NppParameters::getInstance()->getWinVersion();
                          if (ver >= WV_VISTA || ver == WV_UNKNOWN)
                          {
                              SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
                              PSID AdministratorsGroup;
                              is_admin = AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup);
                              if (is_admin)
                              {
                                  if (!CheckTokenMembership(NULL, AdministratorsGroup, &is_admin))
                                      is_admin = FALSE;
                                  FreeSid(AdministratorsGroup);
                              }
                          }
                          else
                              is_admin = false;
                      
                          _isAdministrator = is_admin ? true : false;
                      }
                      
                      1 Reply Last reply Reply Quote 2
                      • Alex BoyceA Offline
                        Alex Boyce
                        last edited by

                        I have also experienced this issue and I was able to resolve it.

                        First, I got into this situation with Notepad++ itself. I tried to edit a file in the Program Files tree and was prompted by Notepad++ that I needed to be in admin mode to do that and did I want to restart Notepad++ in admin mode. I clicked Yes and have been in admin mode ever since.

                        As noted above, drag and drop from a non-admin explorer doesn’t work, but the context menu Open with Notepad++ does, so it wasn’t too much of a hardship. However, it is annoying, so I tried to find out how to turn it off. There is no setting within Notepad++ for it, nor is the compatibility mode tab on the properties sheet checked.

                        I did a google search and found this thread. One of the suggestions was to search the registry for Notepad++. I tried this and found the magic key. Under HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatability Assistant\Store there was a value named C:\Program Files\Notepad++\notepad++.exe. I deleted this value and restarted Notepad++ and it is in normal mode again.

                        I have been able to repeat this by dragging a file from the Program Files tree into Notepad++ which works fine, but when you try to save it, the reopen in admin mode prompt appears.

                        Thanks for the help.

                        EkopalypseE 1 Reply Last reply Reply Quote 4
                        • EkopalypseE Offline
                          Ekopalypse @Alex Boyce
                          last edited by

                          @Alex-Boyce

                          thx for the information.
                          Because you ended with Thanks for the help. I’m unsure if you expect an answer
                          on an implicit question, which I was not able to identify (non-native speaker).

                          1 Reply Last reply Reply Quote 0
                          • Alan KilbornA Offline
                            Alan Kilborn
                            last edited by

                            Similar discussion relating to the original topic here is continued IN-THIS-THREAD …

                            1 Reply Last reply Reply Quote 1

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors