How To: Delete or Clear Pagefile at Shutdown in Windows 10

RECOMMENDED: Click here to fix Windows errors and optimize system performance

The exchange file stores the virtual memory used by the operating system when the physical memory (RAM) is insufficient to meet all running applications and system requirements. Windows 10 creates a special pagefile.sys file in the root directory of your system drive, like all previous versions of the operating system. You can delete the pagefile file when closing to increase security.

Deleting the stopped exchange file can be important if the PC is used by someone else. It is possible that the exchange file may contain sensitive data after the operating system has shut down. If you have a dual boot system or someone with physical access to your computer, data can be retrieved from this file. When Windows 10 is running, it has exclusive access rights to this file so that none of the applications can read it. However, if your entire partition is not encrypted with Windows BitLocker or similar technology, nothing protects this file if the partition of the installed operating system is accessible by booting another system. In this case, you must delete the exchange file at each stop and replace your confidential information with zeros.

Here is How Windows Clears Pagefile

When you turn off your computer, the system memory is always cleared – it is cleared when it is turned off. But it’s not the exchange file. If you are concerned that someone is looking for sensitive data that may remain in your exchange file, Windows can delete it every time it stops. It writes 0 in each bit of the exchange file and overwrites all existing data. When someone deletes the hard drive from your computer, they cannot check the exchange file to find potentially sensitive data that may have been stored in memory.

There is a real disadvantage to enabling this function. Your computer will take much longer to shut down. Your downtime can vary from a few seconds to a few minutes or even more. This depends on the speed of your computer’s hard drive and the size of your exchange file. This is why Windows does not automatically delete the exchange file when closing. It’s a compromise that most people wouldn’t want.


We now recommend using this tool for your error. Additionally, this tool fixes common computer errors, protects you against file loss, malware, hardware failures and optimizes your PC for maximum performance. You can fix your PC problems quickly and prevent others from happening with this software:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.


Delete the file page file.sys

  1. Open the Control Panel and search for “Advanced System Settings”.
  2. In the Performance section, click Settings on the Advanced tab.
  3. Select the Advanced tab again in the window that opens and click on the’Edit…’ button under Virtual Memory.
  4. Clear the “Automatically manage pagination file size for all drivers” check box and enable the “No pagination file” option.
  5. You can also change the file size by setting it yourself.
  6. At the end click on “Apply” and “OK” and restart your PC.
  7. The swapfile.sys and pagefile.sys files should disappear from your hard disk.

Using Regedit

Start Regedit. If you are not familiar with regedit, please read our FAQ to find out how to get started.

  1. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
  2. Select ClearPageFileAtShutdown from the list on the right.
  3. Just next to it and select Change.
  4. Change the value to 1 to enable it.
  5. Restart your computer.

Using the Windows Group Policy Editor

If you are using the Pro or Enterprise version of Windows, you can use the Group Policy Editor to automatically delete the exchange file. First, locate and open gpedit.msc in the Start menu.

The above action opens the Group Policy Editor. Navigate to “Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options” on the left.

  1. Locate the right pane and double-click the Stop: File Deletion Policy button on the virtual storage page.
  2. In the policy settings window, select the Radio enabled option, then click the OK button to save the changes.
  3. Then simply reboot your system for the changes to take effect and you are ready to go. If you want to return, simply select the radio option “Off” in the Policy Settings window.

RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance