68

I accidentally opened a very, very large file (well not accidentally, but I didn't think it would crash Notepad++). Now whenever I try to open Notepad++, the program crashes, so I can't just turn off the setting. I also don't have admin privileges.

Reed Oei
  • 1,427
  • 2
  • 13
  • 19
  • 2
    http://superuser.com/questions/540286/notepad-how-to-reset-all-the-setting-to-default-ones – rovyko Jun 30 '15 at 14:43

7 Answers7

108

Delete
C:\Users\<YourUsername>\AppData\Roaming\Notepad++\session.xml
or shorter
%AppData%\Notepad++\session.xml

Andy
  • 3,997
  • 2
  • 19
  • 39
  • Strangely, I don't even have a file called "session.xml" in that folder. I even tried deleting the entire folder, to no avail. And yet, Notepad++ still crashes with "Exception On WM_CREATE: Unknown exception" which I assume is from opening a file that is too large as it consumes around 1 gb of memory first. – Reed Oei Jun 30 '15 at 14:52
  • @Kytuzian Are you using an up-to-date Notepad++ version? – Andy Jun 30 '15 at 14:53
  • I have version 6.7.8.2 – Reed Oei Jun 30 '15 at 14:58
  • @Kytuzian Does Method 2 from http://www.joomlaboy.com/tutorials/computers/77-solutions-remove-last-file-from-notepad-startup work? – Andy Jun 30 '15 at 15:00
  • @Kytuzian Maybe reinstall? That seems pretty weird – Andy Jun 30 '15 at 15:11
  • I guess I'll have to, I tried to edit the config.xml file in the %appdata%\Notepad++\ folder, but that particular setting doesn't seem to work (while the rest do). – Reed Oei Jun 30 '15 at 15:16
9

You might be able to run Notepad++ with the -nosession command line flag which is documented as "Launch Notepad++ without previous session" (An earlier version of the documentation had "Use this parameter to launch Notepad++ without loading the previous session (the files opened in Notepad++ at the last time).)."

The session.xml file, plus other configuration files, can be in various locations. See the "Configuration Files Location" section of this page for the locations. (Actually the file locations are discussed in several places on that page.)

See also this answer Notepad ++ doesn't save document on exit? which is about controlling whether Notepad++ reloads all its previous tabs when it is restarted.

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
3

Type the path in the windows file explorer as follows:

C:\Users\USER NAME HERE\AppData\Roaming\Notepad++\backup

Clear everything in this folder and that's it!

LundinCast
  • 9,412
  • 4
  • 36
  • 48
2

Simply delete

C:\Users\<YourUsername>\AppData\Roaming\Notepad++\session.xml

and

C:\Users\<YourUsername>\AppData\Roaming\Notepad++\config.xml

After that, the Notepad++ history of previously opened files will be empty.

Since Notepad++ v8.4.7 for recent files history clearing use menu File > Empty Recent Files List

Before clearing

After clearing the File menu will be look like:

After clearing

Vitalii
  • 53
  • 1
  • 7
1

Notepad++ v7.4.2 (32bit) | This solution requires no extra effort before or after launching Notepad++.

 Settings/Preferences/Backup
 Uncheck "Remember current session for next launch"
 It's at top under [Session snapshot and periodic backup]
Wendell Holmes
  • 181
  • 1
  • 2
0

Take a backup of your file and delete the one which you tried open in Notepad++. Your Notepad++ should resume to its normal state. You can then copy the file to its original path from the backup you took.

For large files, use EmEditor

Harshita Sethi
  • 2,035
  • 3
  • 24
  • 46
-1

Access the below file:

%AppData%\Notepad++\config.xml

Delete unwanted search cache marked as <Find name = “ BAD SEARCH”>