Notepad++ Session Recovery: What Periodic Backup Saves and What It Does Not
Distinguish Notepad++ session state, periodic snapshots, and real backups; locate the active configuration safely and recover edits without overwriting originals.
Notepad++ can reopen a working session and retain edits that have not been deliberately saved, but those behaviors are separate from a durable backup system. Remembering which files were open is session state. Session snapshot and periodic backup keeps a temporary recovery copy of changed documents. Neither feature replaces a versioned, separately stored backup of important files.
This difference matters after a crash, profile migration, or a mistaken assumption that every unsaved tab is safely archived. The documented periodic-backup files are temporary: they can be removed when a file is manually saved or closed, and the Notepad++ manual explicitly warns that this feature is not long-term backup and that a crash can still lose data.
Understand the two related preferences
In Settings → Preferences → Backup, Remember current session for next launch saves the list of files that are open when Notepad++ exits. Enable session snapshot and periodic backup is a separate option that depends on remembering the current session. It periodically saves changed files to the configured backup directory and is also what lets Notepad++ restore unsaved changes after a normal exit.
Choose deliberately:
- Enable both options if reopening tabs and recovering recent unsaved edits is part of the workflow.
- Leave periodic snapshot disabled if you want Notepad++ to prompt before closing modified documents rather than silently retaining them as unsaved session state.
- Regardless of the choice, save valuable work to its real path and use an independent backup or version-control system for durable recovery.
Periodic snapshots are not a history of every edit. The manual states that a snapshot can be deleted after a manual save or when the open file is closed. It is designed to recover current in-progress work, not to restore yesterday’s version or survive every failure mode. Never treat the presence of the backup directory as proof that a file has a recoverable copy.
Find the active settings and snapshot directory
In a normal per-user installation, Notepad++ stores configuration under %AppData%\Notepad++; the default periodic backup location is %AppData%\Notepad++\backup. But installation mode and command-line options can change where configuration is read from. Portable mode uses a doLocalConf.xml marker beside notepad++.exe and stores configuration locally. -settingsDir selects an alternate settings directory. Cloud settings have their own documented location rules, including special handling for session.xml.
Use the application preferences and configuration-file documentation to determine the active path before searching for recovery data. Do not copy an arbitrary session.xml from an old machine over the current one: it may describe a different set of open files and unsaved tabs.
For a normal profile, inspect likely files without changing them:
$root = Join-Path $env:APPDATA 'Notepad++'
$backup = Join-Path $root 'backup'
Get-ChildItem -LiteralPath $root -Force -ErrorAction SilentlyContinue |
Select-Object Name, Length, LastWriteTime
Get-ChildItem -LiteralPath $backup -Force -ErrorAction SilentlyContinue |
Sort-Object LastWriteTime -Descending |
Select-Object -First 20 Name, Length, LastWriteTime
If the application is using portable or alternate settings, replace $root with the active location established from its configuration. Inspect the newest plausible files first, but do not assume the filename alone proves which document contents are inside. Make a copy of candidate recovery data to a separate working directory before opening or editing it.
Recover without destroying evidence
- Close Notepad++ normally if it is still running and stop editing the affected file elsewhere. This avoids competing writes to the same session or backup path.
- Copy the complete active Notepad++ configuration directory and the candidate backup files to a separate recovery folder. Preserve timestamps and leave the originals untouched.
- Identify the target document from its recorded path and contents. Compare the recovered text with the file on disk; do not replace the disk copy until you have reviewed the diff.
- Save the recovered version under a new filename or in a version-control branch first. Once verified, merge or replace the original through the ordinary review process.
- Reopen Notepad++ and confirm the configured session and backup paths match the profile you intend to use.
If Notepad++ starts with an empty session, first verify that the application is reading the same profile used before the failure. A different Windows account, portable copy, -settingsDir argument, or cloud-settings configuration can make the expected files appear to have vanished even though they are in another configuration directory. If the snapshot was already removed or never written, the editor cannot reconstruct the unsaved text from session metadata alone.
Save named sessions for repeatable work, not as backups
File → Save Session writes a reusable list of files and editor state. It is useful for a project-specific set of tabs, but it is not the same thing as the default session snapshot. The manual notes that unsaved unnamed documents are not included in a manually saved session; save those documents to real paths first if you need them in a named session. Named sessions can also interact with multi-instance settings, so test the exact launch workflow if you open multiple Notepad++ windows.
Keep session files in an appropriate user-controlled location. A session can reveal local paths and the names of sensitive documents even when it does not contain their full saved contents. Periodic backup data can contain the actual unsaved text. On shared systems, protect the profile and backup directory with the user’s normal Windows access controls, and include them in retention and data-handling decisions.
Make recovery testable
Use a disposable text file to verify the behavior after changing preferences: edit it without saving, wait beyond the configured interval, close Notepad++ normally, and confirm whether the expected session or snapshot returns. Then manually save and close it and observe that the temporary recovery copy may be removed. Repeat with the actual installation mode and Windows profile used on the machine.
For important work, rely on explicit saves, version control, or a separate backup product with known retention and restore tests. Notepad++ session recovery is a useful last-mile convenience for recent edits; it is not a substitute for a backup policy.
Related:
- WinGet for Reproducible Windows Package Operations
- Automating Configuration Drift Prevention with PowerShell DSC
Sources: