CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007
    Posts
    117

    How to stop Windows from auto-saving to AppData

    Hi everyone,

    I have an application that for some reason lets Windows automatically store a backup file to C:\Users\Username\AppData\Local
    This happens every 5 minutes or so.
    Now, in principle this shouldn't be a problem, but in rare cases memory use for this application can be something around 10GB.
    In this case the program will freeze for about 30 seconds every 5 minutes to perform the save.
    I'm not sure why these auto-saves are being performed, because from what I can tell, none of my other applications seem to do this.
    The application is written in C++ in Visual Studio 2017.
    Is there some setting that prompts these saves, or some other way or preventing them?

    Thank you in advance.

  2. #2
    Join Date
    Jan 2013
    Location
    Largo, FL.
    Posts
    356

    Re: How to stop Windows from auto-saving to AppData

    I would assume that the Application itself is doing the save. It would be the only app that has a vested interest in protecting you.

  3. #3
    Join Date
    Sep 2007
    Posts
    117

    Re: How to stop Windows from auto-saving to AppData

    Ok, I think that I figured it out.
    It appears that these files are created by Windows Restart Manager.

    This is because in CMyProgrammApp::CMyProgrammApp() the following flag is set:

    m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS;

    By changing this to

    m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_NO_AUTOSAVE;

    the auto-saving appears to now have stopped.
    I've had to manually make this change.
    I can't find anything under Tools or "Project->MyProject Properties".

    If anyone knows where this is located in the menu for Visual Studio then please let me know.

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,824

    Re: How to stop Windows from auto-saving to AppData

    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  5. #5
    Join Date
    Feb 2017
    Posts
    677

    Re: How to stop Windows from auto-saving to AppData

    Quote Originally Posted by rmirani View Post
    If anyone knows where this is located in the menu for Visual Studio then please let me know.
    It seems Restart Manager support in MFC is selected in the application wizard.

    https://mariusbancila.ro/blog/2009/0...anager-in-mfc/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured