Unless you have saved your session in the cloud, like the previous answer, you can't restore your whole session. You can, however, restore your unsaved (new) notes. They are stored at:
%APPDATA%\Notepad++\backup
You may either open all those files directly in Notepad++, or you can remake the session file in:
%APPDATA%\Notepad++\session.xml
so that the <mainView>
section will include all of them.
Here's a Python script to make it easier to redo the session file. Just paste the output between the <mainView>
and the </mainView>
tags:
import os
import os.path as osp
npp_path = osp.join(osp.expandvars('%APPDATA%'), 'Notepad++', 'backup')
for fn in sorted(os.listdir(npp_path), key=lambda fn: fn.split('@')[1]):
name = fn.split('@')[0]
print('<File firstVisibleLine="0" xOffset="0" scrollWidth="64" '
'startPos="8" endPos="8" selMode="0" lang="Normal Text" '
'encoding="-1" userReadOnly="no" filename="{name}" '
'backupFilePath="{npp_path}\{fn}" originalFileLastModifTimestamp="0"'
'originalFileLastModifTimestampHigh="0" '
'mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" '
'mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" '
'mapWidth="-1" mapHeight="-1" mapKByteInDoc="0" '
'mapWrapIndentMode="-1" mapIsWrap="no" />'.format(
name=name, npp_path=npp_path, fn=fn))
I searched for the session.xml file on C:\Users\user.user-PC\AppData\Roaming\Notepad++ but it got "reset" and isn't showing all the old opened tabs. I went to [right click] > Preferences > Old Versions but there's no old version available. On Windows Temp folder there're no "session" files, on "n++" or "npp" or "notepad" files :( – Peanuts – 2018-07-27T16:41:58.427
Possible duplicate of Is there any way to recover unsaved notepad++ docs?
– JonathanDavidArndt – 2018-08-21T13:02:23.447