|
| 1 | +--- |
| 2 | +title: Set AutoRecover options |
| 3 | +description: Learn about the AutoRecover, Environment, Options dialog box and how it's used to specify whether or not to automatically back up files. |
| 4 | +ms.date: 08/07/2025 |
| 5 | +ms.topic: reference |
| 6 | +f1_keywords: |
| 7 | +- VS.DialogAutoRestore |
| 8 | +- VS.ToolsOptionsPages.Environment.AutoRecover |
| 9 | +- VS.ToolsOptionsPages.Environment.Auto_Save_and_Restore |
| 10 | +helpviewer_keywords: |
| 11 | +- files, recovering |
| 12 | +- AutoRecover page |
| 13 | +- saving files, automatically |
| 14 | +- files, saving automatically |
| 15 | +ms.custom: "ide-ref" |
| 16 | +author: anandmeg |
| 17 | +ms.author: meghaanand |
| 18 | +manager: mijacobs |
| 19 | +ms.subservice: general-ide |
| 20 | +--- |
| 21 | +# Set AutoRecover options |
| 22 | + |
| 23 | +You can configure Visual Studio to automatically back up files or not. You can also specify if you want to restore modified files if Visual Studio shuts down unexpectedly. |
| 24 | + |
| 25 | +1. To access this dialog box, go to **Tools** > **Options** > **Environment** > **AutoRecover**. |
| 26 | + |
| 27 | + :::image type="content" source="media/autorecover-options.png" alt-text="Screenshot of the AutoRecover section in the Options dialog box"::: |
| 28 | + |
| 29 | +1. Select **Save AutoRecover information every [n] minutes**. |
| 30 | + |
| 31 | + ::: moniker range=">=vs-2022" |
| 32 | + |
| 33 | + Use this option to customize how often a file is automatically saved in the editor. For previously saved files, Visual Studio saves a copy of the file in ***%LocalAppData%\Microsoft\VisualStudio\BackupFiles\\[projectname]***. If the file is new and you haven't saved it yet, Visual Studio autosaves it by using a randomly generated file name. |
| 34 | + |
| 35 | + ::: moniker-end |
| 36 | + |
| 37 | + ::: moniker range="vs-2019" |
| 38 | + |
| 39 | + Use this option to customize how often a file is automatically saved in the editor. For previously saved files, Visual Studio 2019 version 16.2 and later saves a copy of the file in ***%LocalAppData%\Microsoft\VisualStudio\BackupFiles\\[projectname]***. If the file is new and you haven't saved it yet, Visual Studio autosaves it by using a randomly generated file name. |
| 40 | + |
| 41 | + > [!NOTE] |
| 42 | + > If you are using Visual Studio 2019 version 16.1 or earlier, the file location is *%USERPROFILE%\Documents\Visual Studio [version]\Backup Files\\[projectname]*. For more information, see the [Visual Studio 2019 Release Notes History](/visualstudio/releases/2019/release-notes-history/) page. |
| 43 | +
|
| 44 | + ::: moniker-end |
| 45 | + |
| 46 | +1. Specify a value under the **Keep AutoRecover information for [n] days** option. |
| 47 | + |
| 48 | + Use this option to specify how long Visual Studio keeps files created for autorecovery. |
| 49 | + |
| 50 | +### See also |
| 51 | + |
| 52 | +- [Options dialog box](../../ide/reference/options-dialog-box-visual-studio.md) |
0 commit comments