10

How do I remove a file from Notepad++ startup session which immediately sends the program into 'Not Responding' state, or how can I start NPP with a blank slate session?

I can close the program, but as soon as I reopen it, it loads this troublesome file as part of the previous session.

I can't access the settings because the program it's always in 'Not Responding' state.

Is there a section in the registry I could reset?

1
  • 1
    I am curious as to how any input file would disable npp. You should post a bug report (on npp’s github issues page) with a copy of the smallest file you can create that causes the problem to manifest. ? Hmm: Do you have any custom syntax highlighting going on? Does the issue disappear if you turn SH off?
    – Dúthomhas
    Commented 10 hours ago

3 Answers 3

14

How do I remove a file from Notepad++ startup session?

I don't think notepad++.exe uses the registry for this information as it uses xml files for configuration.

The file information is stored in session.xml, which is located in %AppData%\Notepad++\ for a standard installation or in the same directory as the notepad++.exe executable for a portable installation.

You can use a different editor to edit session.xml and remove the offending file information.

You should also be able to delete session.xml and notepad++.exe should create a new one. I haven't tried this.

Example session.xml file entry:

 <File firstVisibleLine="57" xOffset="0" scrollWidth="1701" startPos="1655" endPos="1655" selMode="0" offset="0" wrapCount="1" lang="PowerShell" encoding="-1" userReadOnly="no" filename="C:\Powershell\profile.ps1" backupFilePath="G:\apps\Notepad++\backup\profile.ps1@2025-08-08_155458" originalFileLastModifTimestamp="194636805" originalFileLastModifTimestampHigh="31180527" tabColourId="-1" RTL="no" tabPinned="no" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="512" mapWrapIndentMode="-1" mapIsWrap="no" />

Further Reading: Configuration Files Details | Notepad++ User Manual

4

You can start Notepad++ from the prompt with the -nosession argument. This will not attempt to load any previously opened files.

Assuming the default 64-bit installation location and a PowerShell prompt:

cd "\program files\notepad++\"
.\notepad++ -nosession

Documentation

2
  • 1
    Will this be required every time, or will it cause the settings to be deleted or overwritten? Commented 12 hours ago
  • 3
    No, it just won't open files that were open in the last session. Once you then close NPP, you can reopen as normal.
    – Alan B
    Commented 12 hours ago
1

If you know the identity of the offending file, you can delete, move, or rename it; then start Notepad++ and it will stop trying to open the file on startup. If the file is in an "unsaved" new tab, you may be able to find it in %AppData%\Notepad++\backup or %AppData%\Roaming\Notepad++\backup.

New contributor
Darlingtonia is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.