How to clear memory cached files programmatically with C++? Specifically Notepad cache?

Ricardo N. Ponce 0 Reputation points
2024-08-14T17:41:29.91+00:00

Windows 11 Notepad is truly annoying! It keeps opening tabs with previous opened files. I don't want that! I only want to open Notepad with one empty tab.

How can I avoid that? Or delete the cache memory with a C++ program? Or perhaps with a Notepad command with a switch from the command line?

Please comment. Thank you!

Ricardo N. Ponce

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,332 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,981 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,693 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,478 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 53,971 Reputation points
    2024-08-14T17:45:11.0666667+00:00
    1. Open notepad
    2. Click on Settings gear on right side of window
    3. Go to Opening Notepad > When Notepad starts and set it to Open a new window

    It won't remember your previous sessions. This is a feature that Notepad++ has that a lot of people like so it makes sense to include it in the app that Notepad++ replaces.


  2. Ricardo N. Ponce 0 Reputation points
    2024-08-16T20:26:15.4333333+00:00

    Thank you, Michael! I do appreciate your comments and time.

    Would you perhaps know of an editor although very simple that I can open from a C++ program? Other than Notepad, of course. I mean something like this window we are using right now. Just a simple one that I can open and write on, and save back to a text file from a C++ program. I guess there must be some out there, but I just can't find it, and that is why I am using Notepad.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.