Stuck in "Administrator" mode...how to get out?
-
How is it generally with a user account?
Here is an example of two programs on the same machine. -
i think i found something i can reproduce:
i’ve set up a windows 7 x64 bit test vm with a standard user.
if i start notepad++ portable or installed, it loads as this default user.i’ve then entered the user settings and slided the user access control slider from default down to off (disable uac) and rebooted.
tadaaaa: from now on i always see [Administrator] in the notepad++ top bar, even if it is not running as administrator.
maybe it’s the same on your system ?
maybe the it guy temporarily disabled uac because he was annoyed by it while he was setting up something, and he just forgot or didn’t bother to re-enable it again ? -
i think that administrator detection of newer versions of notepad++ relies on an active user access control.
what happens if you re-enable uac and set it to default for a test, then reboot ?
does it still say [administrator] in your portable 7.6.2 or is it gone then ? -
True UAC is disabled!
-
Yesterday I reinstalled the 7x64 operating system, and turned it off myself.
-
Here’s how that screen looks for me:
-
-
Not sure why people are upvoting my UAC screenshot. I guess I should say that I didn’t change that setting in any way and just posted it here so Meta Chuh could see what I have and what I’ve always had there. My problem still exists (just to be clear).
-
I tend to upvote good answers, or replies that ask questions I think are worth asking, or replies that directly and informatively answer those questions or add useful information to a discussion: knowing that having UAC enabled does not fix it for you is useful to the discussion – it says that “well, we haven’t yet found the root cause”. It’s unfortunate, but it still helps move the thread forward.
-
i second that.
i gave you an upvote on your screenshot, because you actually took the time to do so.
of course it doesn’t solve your issue and no one thinks it’s solved just because you got the slider way up and posted it, and for you it’s probably a natural thing to participate to get issues solved, but you’ve seen for yourself how few people do the same and keep reposting the same thing over and over again without trying anything suggested.
i simply had to give you an upvote for it, it’s in my nature ;-)
-
Thanks for everyone’s efforts so far…
-
@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 😂😂😂 ;-)
-
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.
-
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 😉 -
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.
-
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. ⁉️
-
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! :)
-
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.
-
@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; }
-
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.