Solutions: remove last file from Notepad++ startup

I ran to an interesting problem today. I backed up a Magento store database which was approximately 250MB of size. For some reason my Notepad++ couldn’t handle it and crashed every time I tried to open it. So annoying that Notepad++ has the setting to remember last files in its session, so I was unable to use Notepad++ anymore since every time I tried to run it, it started working on opening that 250MB sql dump it had in its session history. 

This is how you can remove recent files from opening with Notepad++ 


Method 1 – edit session.xml

1. Open file session.xml in C:\Users\Username\AppData\Roaming\Notepad++ or %APPDATA%\Notepad++
2. Delete its contents and save it
3. Run Notepad++ , session.xml will get new content automatically


Method 2 – add the -nosession parameter to Notepad++ shortcut

1. Create a desktop shortcut referring to your Notepad++ program, e.g. C:\Program Files\Notepad++\notepad++.exe
2. Right click on this shortcut
3. In the “Target” field add the -nosession parameter so the target field looks exaxtly like (apostrophes included too): “C:\Program Files\Notepad++\notepad++.exe” -nosession
4. Save and run Notepad++ from this shortcut icon with no recent files 

notepad nosession parameter


Method 3 – edit Notepad++ settings

1. Run Notepad++
2. In menu go: Settings -> Preferences -> Misc. Tab
3. Uncheck “Remember current session for next launch” 

notepad remember session

Post Author: Tom Pai