Help: N++ crashes when "run as admin"
-
Hi N++ advisors/moderators…Can someone pls HELP: Now, N++ stops/“crashes” when I select “run as admin”, which is my usual method of starting. Unsure why this has occurred; in my last session, the only thing I did noteworthy was to add to my “hosts” file…Is this the cause of the crash? Tried appending “-nosession” gave me error warning of “-nosession” is not recognized", so trying to avoid my last session doesn’t work, as recommended.
Pls HELP - wish to return to “run as Admin” normally! INFINITE THANKS to any kind soul that can help me (other than re-installing, and trying to recover all my files :(( ) — can’t live without N++ !!! — -
@L-Smxxx said in Help: N++ crashes when "run as admin":
Can someone pls HELP: Now, N++ stops/“crashes” when I select “run as admin”, which is my usual method of starting.
Generally when there is a shift in function like you experienced there has to be a cause. Possibly the OS was patched, N++ was updated, or a configuration change was made in N++.
Can you recall any change that occurred?
Some options are to uninstall any Windows patches to see if that changes things. They will get automatically reinstalled by Windows later again, but it is a easy test to perform.
Maybe install a portable version of N++, run that and see if it can function. If it does then maybe a setting within N++ has got corrupted. As you “run as admin”, I’m not sure where the config files for that lie, but unlikely to be the ones at %appdata%\Notepad++. More than likely they will be the ones in the Notepad++ folder under Program Files. Possibly back those up and replace with the ones from a portable installation of the same version.Terry
-
HI Terry, thx for your reply, but I believe my bug is not of the categories you’ve mentioned. As I said, I believe my bug is related to the only thing I did “differently” outside of plain-vanilla coding (that never caused a problem): I added a new host to the “hosts” file, WITHIN N++, but actually adding a file in my C drive, win 7. (This addition was found online, btw, and I haven’t found another user who developed this problem.) Since I can’t access Admin, I can’t delete this addition - “double whammy” of trouble !
(Unless some other kind soul can help, have no solution except to download/re-install :( —> posting a new question towards this new download, anyway) -
@L-Smxxx ,
Editing the
hosts
file should not affect Notepad++ in any way, shape, or form. I do not see how a change tohosts
could cause Notepad++ to cease working, whether in normal mode or run-as-admin. Until you provide proof, I would work under the assumption that something else changed as well, as @Terry-R already suggested. -
@L-Smxxx ,
… Moreover, do you notice in @Terry-R’s advice to “install a portable version of N++, run that and see if it can function”. That is effectively what my advice in the other thread is telling you how to do.
BTW: Terry said,
As you “run as admin”, I’m not sure where the config files for that lie
There aren’t any config files specific to “run as admin” – if, by run-as-admin, @L-Smxxx meant right clicking on the executable or shortcut and selecting the “Run as Administrator” option, or, in the shortcut, going to Advanced and selecting “Run as administrator” so that the shortcut always runs as admin. If @L-Smxxx actually meant, “I logged into Windows using my Administrator account instead of my normal user account”, then the Administrator user will have its own
%AppData%\Notepad++
directory.Anyway, back to @L-Smxxx :
(If you are confused by my
%AppData%
nomenclature, see my other post about%AppData%
for more)I am actually wondering whether it is “crashing” because you’ve got some file open that no longer exists. If that’s the case, then trying to run
notepad++.exe -nosession
as administrator might work; to do that:- open a cmd.exe window as administrator (type
cmd
in the windows/cortana search, then right click on the Command Prompt app which should be first in the search, and select “run as administrator”)- the cmd.exe window should have
Administrator
in the title
- the cmd.exe window should have
- type
c:\program files\notepad++\notepad++.exe -nosession
in that administrator cmd window- Notepad++ will hopefully open up, and admit to being in Administrator mode (in the title bar, and in ? > Debug Info)
- If 1 and 2 worked okay for you, then the problem wasn’t with Administrator, per se, but with one of the files you were trying to open. If that’s the case:
- Close all instances of Notepad++
- Rename
%AppData%\Notepad++\session.xml
to something like%AppData%\Notepad++\old-session.xml
- Restart your installed Notepad++ normally, make sure it works
- Close. Start your installed Notepad++ as administrator, and see if it works.
- If it works, great! If you want to know the files that you used to have open
- open
%AppData%\Notepad++\old-session.xml
- that will list all the files in attributes in XML format. You should be able to see the paths
- I suggest opening those files one at a time from your run-as-admin Notepad++, possibly closing Notepad++ in between, and making sure that you can still run-as-admin with each open. If any one of those files causes you to not be able to open as admin, then that file was likely the culprit (or at least, one of the culprits).
- open
@L-Smxxx said,
I believe my bug is not of the categories you’ve mentioned.
Sorry, but as far as you’ve explained, you didn’t do nearly enough debug to have any reason for that belief (except maybe “I don’t want to be wrong”). You asked a question, and were given a good reply, which gave advice on how to debug the problem; instead of following that advice, 16 hours after the advice you came back and said “I believe my bug is not [that]”, and then made another post where you whined that there was “No solution yet, so I’m forced to reinstall” – a completely unfounded claim. If you don’t follow the advice you are given, don’t whine about not having a solution yet.
If you really want to fix the problem, rather than just whine: run the experiments that Terry suggested; run the experiments that I suggested; put in the effort to learn from our advice, and possibly do some back and forth with questions.
If, after you’ve followed our advice, and done some back and forth debugging the problem, if you’ve proven that one of the portables is working fine in admin mode, and if you’re still sure that your installed copy isn’t working in admin mode, you could do the following steps:
-
Make sure you know all the files that you had in the old installation, and have copied any of the
new #@....
files from the old backup directory into a different, known location, as described in point #2 near the end of my post in the other discussion -
Uninstall the old copy of Notepad++, and delete
%AppData%\Notepad++
and everything in it. -
Download a new installer that matches the portable version that was working for you
-
Install that copy, and make sure it works
- open a cmd.exe window as administrator (type
-
THANKS so very much, Peter and Terry! Yes, I may have been premature in stating that “I don’t believe that…”, in my reply to Terry. Peter, your replies are also excellent, esp in confirming that changing the “hosts” file "shouldn’t " affect N++, however, something “was” definitely changed bc, again, I cannot enter run-as-admin via the dropdown menu, as is my practice. I will perform the solutions you’d recommended, and hopefully return with good news. — Nevertheless, THANK YOU very much to you BOTH, for (your very kind!) time, patience, and assistance! (PS, Have a great holiday!)
-
Addendum to previous “thanks”: Wished to confirm that my problem is selecting run-as-admin via the dropdown menu (and not via Windows, as admin): selecting this option no longer exists. Since my change to the hosts file, when I try to select this option, “nothing happens” - this is the “crash” I’m referring to…sorry for any misunderstanding re my poor, garbled explanation. (Also, in this scenario, interestingly, the entire N++ “depiction” on my screen “lightens” terms of its display; the dropdown menu, etc, is “not as dark” as it usually is. ) – Again, thanks so much to BOTH, and I’ll be working through your recommendations.
-
Peter, if you’re “checking in” to users’ responses to your responses: Can you kindly explain what is, and how to acquire, “portable version” of N++? Am unfamiliar with this term. And what is the difference between that, and a “regular” version? – Would like to implement your and Terry’s advice. — Infinite THANKS, yet again …esp for your patience, and kindness(!) for helping “lost souls” like myself!
-
@L-Smxxx said in Help: N++ crashes when "run as admin":
Can you kindly explain what is, and how to acquire, “portable version” of N++?
Sorry, I thought I did explain. I mean, I said, " That is effectively what my advice in the other thread is telling you how to do.". And I linked to the other post. And in that other post, I directed you to https://notepad-plus-plus.org/downloads/ .
Admittedly, the clues ran dry there, probably because I assumed you could figure out the rest: you would have to pick one of the releases (like “Notepad++ 8.1.1 release”, and once on that page, you would see the various download options, including the section like Download 64-bit x64 which contains a link to “Portable (zip)”, and once you saw that link, you would be able to see how to download the portable version.
After downloading the portable zip file, you would have to unzip it to a known location – for example, into
Desktop\npp.8.1.1.portable.x64\
– and then run the portable version from thereAnd what is the difference between that, and a “regular” version?
A regular version comes in a bundled installer, and usually goes into your standard
Program Files
. A portable version runs from whatever folder you unzip it into. The other benefit of the portable is that the portable version by default uses the config files from the same folder you unzipped, rather than using your config files in AppData – this allows you to have multiple copies of Notepad++ with different configurations… which is often the point of running the portable edition (and in your case, to see whether you can get Run As Admin to work for a different copy of Notepad++.