How to delete Notepad cache in Windows 11 Pro?

Anonymous
2023-12-24T04:10:41+00:00

Hello,

I used Notepad (just regular Notepad, not Notepad++) to open a somewhat sensitive file on a USB drive, then closed Notepad and removed the USB drive. Now I notice that when I open Notepad again, it automatically opens up the same file even with the USB drive not plugged in, so it obviously cached the file somewhere. Where is this cache? I'd like to shred the file. I looked in Users/<username>AppData/Roaming/, but I see nothing there for Notepad. There is no option to get the file location from within Notepad itself, something like 'File--> properties'. Both 'File --> Open' and 'File--> Save as' just default to my documents folder, and the file in question is not there. I am using Windows 11 Pro.

I know that Notepad settings can be changed to not open content from the previous session, but my priority right now is shredding the file from my drive.

Thanks for any help.

Windows for home | Windows 11 | Settings

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Ramesh Srinivasan 173.8K Reputation points Volunteer Moderator
    2023-12-24T06:02:21+00:00

    Resetting Notepad should purge the confidential file from the caches.

    Open Settings, Apps.

    Click Installed Apps.

    Search for Notepad.

    Click on the ellipsis icon adjacent to "Notepad", and click "Advanced options"

    Image.

    In the resulting screen, click "Reset".

    52 people found this answer helpful.
    0 comments No comments

10 additional answers

Sort by: Most helpful
  1. _AW_ 64,331 Reputation points Volunteer Moderator
    2023-12-24T06:03:25+00:00

    The Notepad cache can be found as follows:

    • Open File Explorer and copy/paste the following into the address bar > press enter: %localappdata%\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState\TabState
    12 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-12-24T06:53:15+00:00

    Thanks for that. That folder had 3 binary .bin files, all about 1 KB in size, which is too small to contain my file, unless it's perhaps using compression. I tried shredding them anyway, but Bitdefender kept saying I didn't have the permissions to do it, even though I'm logged in as admin (just a personal PC). I then tried Ramesh's solution above, and the files did get removed.

    Shredding would've made me feel better (since deleted files are technically still there until something writes to that memory), but at least the files are deleted now.

    Thanks for the help.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-12-24T06:54:58+00:00

    Thanks for that. I did follow the procedure to reset Notepad and delete the data. Shredding would've made me feel better, but I wasn't able to do that (see my reply to _AW_).

    Thanks for the help

    0 comments No comments
  4. Ramesh Srinivasan 173.8K Reputation points Volunteer Moderator
    2023-12-24T07:25:36+00:00

    Glad that info helped. To prevent the files from being recovered by a third-party data recovery tool, use SDelete with the -c switch.

    -c Clean free space.

    These links can help.

    2 people found this answer helpful.
    0 comments No comments