Forum moved here!

Home / Sumatra doesn’t remember opened files

wwkirk

I am using the PC version of Sumatra. Recently, the program stopped remembering my opened files. When I load the program, it provides a grid of recent files instead of just opening those files.

wwkirk

Never mind, The program is working correctly again. (I didn’t do anything.)

GitHubRulesOK

@wwkirk
It is possible your SumatraPDF-settings.txt file was corrupted or deleted (sometimes happens when windows reboots without closing SumatraPDF cleanly). The file is rebuilt at next start-up, but your history may be wiped-out. If you have a regular set of files in your history It may help to back-up the settings file in case it needs replacing in that preferred state. the file is either alongside SumatraPDF.exe (if portable use) or if installed its in your %appdata%\SumatraPDF folder

Since you say “recent” files were still listed on front screen it is more likely the “remember opened files” setting was disturbed, rather than the file being corrupted ?

Ooker

I’ve checked the option, but it doesn’t work. Why is that?

GitHubRulesOK

There could be several reasons, possibly the settings file has somehow been locked against changes, or the setting is not sticking the way you expect.
Go to advanced settings and first check the entry for RememberOpenedFiles = true

test you can save the settings file

Note the term is plural it will not “remember” the last single file there must be two or more TABS open when you close SumatraPDF using Ctrl-Q (File exit) so open 2 files in tabs and press Ctrl+Q or use file > exit or Alt+F4 now when you open Sumatra are those two files re-opened ?

Usually the last single file open is available via Alt-F and 1

wwkirk

The problem has returned. How do I adjust the “remember opened files” setting?

wwkirk

It fixed itself again.

chris

Hi,

recently I updated my laptop from Win7 to Win10. One of the first things to do was of course installing a good and reliable pdf-viewer. But since the new installation the opened pdf-files are not remembered when I hit the close button, before it worked just fine with the close button. With ctrl + Q it partly works, but only for locally saved pdf’s. Before it was also possible with pdf’s in the temp folder or with opened pdf’s from my email programe. I wonder what is different now and if anyone faces the same problem. I still have the relevant options with the same logical operators as before.

RestoreSession = true
RememberStatePerDocument = true
RememberOpenedFiles = true

Some FileStates have the option IsMissing = true. The majority of these are in the temp folder, but in turn there are files that are also in the temp folder with the false operator.

The SessionData section is empty.

I already have read related threads, but unfortunatly the solution approaches did not help.
https://forum.sumatrapdfreader.org/t/not-remembering-opened-files/1562

I would be glad if someone has a solution for this. Thank you in advance!

Best,
C

GitHubRulesOK

It depends how you may have backed up any files from before system upgrade.
Your settings and analysis are correct.

It is not a good idea to hold referenced files such as those from e-mails in a temp location since that can be wiped on update/upgrade . Thus I suspect if those “temp” files are gone there is little chance of replacement in history without fresh download / save attachments etc.

If the entry in the settings file shows “Is missing = true” then it can open the file with last page number etc IF the file returns to that same location (e.g re-saved from an e-mail)

If the file is in a different back-up folder then the entry “path” would need to be edited in the settings file since opening a file with the same name but different folder will NOT normally use the same history.

Session data is primarily for keeping “tabs”, So tabs need to be on, to see entries in that section
It is dynamic thus if only one file was active at closure there will be NO entries at restart. this an issue for some users since Windows 10 home will close down without saving settings.txt thus tab and file history will be non existent on restart.

Whilst it is possible to build/rebuild incorrect entries in the settings file (via scipting would be easiest) it is not likely to be worth the time manually. The simplest way to reset is to get a collection of pdfs etc in a “library folder” of their own and dragNdrop the folder onto sumatraPDF shortcut so it opens all those files.

When you have a settings file you wish to preserve it is a good idea to make a back-up so it can be used should windows shut-down to update without asking to save settings

chris

Thank you for the answer. Indeed after an upgrade/update the files can be wiped out. That is not the real problem. I saved them before.

The problem is when I open files from my email program or/and from the web and I close sumatraPDF afterwards, they are only partly recovered. E.g. I open two pdf-files from the web and one file from an email I received, then all the pdf’s are compiled in one session (I do not save them seperately). Now, when I close sumatraPDF and subsequently open the programm again, then hey are recovered without seperately saving them on a local folder. But when I close the program and I try to open a newly received pdf-file, then the former file I initially opened from the e-mail is not recoverd. So, the new file is not added to the “whole” session from before. It is odd, because I think I can remember that with Win7 this was no problem. There just all the pdf’s were added to one session, and also opened again. Nevertheless, I think the best option is as you said with the library folder.

Thank you for your help!
Best,
C

GitHubRulesOK

It sounds like in the past you were used to finding historic entries in temporary email/browser folders which would have been possible if you had NOT set delete on closure for such applications. Windows 10 default settings may be such that “temporary/cached” files are cleared on closure, the preference for many apps, but outside of SumatraPDF’s control…

This type of difference would affect your experience as you describe

chris

Yes, I think that is the issue. But actually my behaviour by not saving the documents was negligent anyway, because as you said, after an update or restart the temp folders are probably cleared up. I think in the future I just set up a “temporary” folder in the favourites and save any seemingly interesting pdf there as an intermediate step. Before I was just lazy to do so. :slight_smile:

Thank you again for your description!

Best,
C

wizzard0

Maybe related, since recent files are just never saved for me as well. This has been the case for me on multiple machines for years, from Win7 to Win10 and SumatraPDF from 2.x to 3.2 at least, but recently became more relevant so I decided to finally report the issue.

Where do I look for further diagnostics? Are there any logs or settings I could check?

Anyway, thanks for the great software!

SumatraPeter

@wizzard0: Close the program and then relaunch it after moving your existing SumatraPDF-settings.txt file to another folder. The file will be recreated with default values and as long as it is in a writeable state Sumatra should start remembering opened files once more.

oleg1684

How to restore previous session?

But it don’t work.

GitHubRulesOK

Hi
It should be noted it says fileS that is it will only remember the files if 2 or more were open in the last session.
If you close with only one tab open it will not be opened automatically next time
(there is one exception sometimes used if self updating with only one file open)

That function relies heavily on a clean exit by SumatraPDF when it writes the currently open files to its settings file.

If the exe is closed by the user or system (e.g. a system update) in an uncontrolled fashion, then the file paths will not have been stored and session restore will not happen.
If the files are in a temporary or remote drive / cloud location then restoring a session can also be impacted.

Just a reminder the most common cause for this complaint is an unscheduled windows reboot whilst a session is left open. The best way to guard against that (A windows “Feature”) is to ensure you change settings to hours when not working

Windows Update
Advanced Options

Then ensure you close SmatraPDF correctly before accepting any reboot message

However also note this problem was signifficantly improved by recent changes after version 3.2.0 so consider usin a pre-release version if you wish to reduce the risk of lost sessions.

SumatraPeter

Best to also set Active Hours as per one’s typical usage:

https://support.microsoft.com/en-us/help/4027636/windows-10-get-updates-with-active-hours-in-windows-10

https://www.tenforums.com/tutorials/46468-change-active-hours-windows-update-windows-10-a.html